Hacker News new | ask | show | jobs
by rurban 1947 days ago
Why should I use `_shellmath_divide 1 $zero_factorial` over `bc 1 / $zero_factorial`?

It's imprecise and much more clunky to write. bc exists for decades already and has arbitrary precision.

1 comments

I think shellmath exists because it could be done, rather than because it needed to be done.

Also, `bc 1 / 2` causes an error (at least in bash 3.2 using bc version 1.06) because file 1 doesn't exist, so there's also that for a reason

Yes, it's a POC for anyone who might want to use it or expand on it.