big.js
big.js copied to clipboard
Add params to div, pow, and sqrt
Sometimes it's pretty useful to define rounding mode or decimal places per operation without touching global variable (it's like that in other languages as well, ex. Java's BigDecimal).
- I am adding a possibility to change rounding mode or decimal places without touching
Big.RM
orBig.DP
fordiv
,pow
, andsqrt
operations per single usage. This change is non-breaking, it's just enhancement. - I've also simplified
mod
operation by using new parameters of thediv
operation. - I've added tests that prove it works as expected and non of the old tests were touched and are passing as before.
Please let me know your feedback @MikeMcl. Thanks in advance.
So far I only made changes to .js
file. If all is good I'll update .mjs
as well.