tdenniston/bish

Mathematical functions

egorsmkv opened this issue · 6 comments

Hi, @tdenniston

I have created just such a library: https://gist.github.com/eg0r/4da3b0d75cabcbe29e1f

PR did not do, as it is necessary to formalize the library. I propose to move it to a separate folder and there are going to bish-files to be imported one, for example, stdlib.bish.

Yeah, well, I ask to comment on my code, it can be somehow need to improve?

@eg0r Thanks, this is great!

Your code looks good. I will create a separate folder for libraries and move stdlib.bish there. After that, you can create a PR with this library.

One question: is bc available on all systems? Do you know of any systems without bc?

@tdenniston As suggested by Wikipedia must be in UNIX. But it is possible to check in functions that will display abort.

@tdenniston By the way, floating point numbers, you can do so.

def float(x) {
  cmd = "scale=3; $x/1.0";
  return @(echo $cmd | bc);
}

println(float("43")); # => 43.000

@eg0r You can submit a PR for this library now.

Sorry to intrude ,
I am a programmer without university education trying to teach myself compilers by working on open source projects . I would really appreciate if you could give me simple tasks , some guidance ,anything at all . All help appreciated

@sandeep06011991 Notes? Clone project and experiment!