Open kaue opened 5 years ago
@calidion currently the precision is defined at
https://github.com/kauegimenes/bbp-formula/blob/master/index.js#L3
I was thinking about making it an option something like that:
const calculatedPi = bbp(0, {precision: 100000});
That would work for you?
Is it the maximum precision?
I would like to have a program to have infinite precision ability, if precision is not specified. I would get output like this.
3.1415926...
each digital is generated overtime, and will continue to put new digital to the next precision. like this program: https://bellard.org/pi/pi.c
from decimal.js source:
// The limit on the value of `precision`, and on the value of the first argument to
// `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.
MAX_DIGITS = 1e9, // 0 to 1e9
I can update the precision to be equal to 1e9 by default, that would work for you?
Can the precision be dynamic?
Not sure
Would you consider this algorithm? https://bellard.org/pi/pi2700e9/pipcrecord.pdf It seems no need to use Decimal, normal javascript primitives will be ok.
@calidion I don't have time to make big changes to this package, but feel free to create a PR if you want to.
OK.
@calidion any progress on this? ;)
Sorry, I don't have time currently.
Oh, no problem. i hope we can add stuff to this package in the future.
Issue reported at https://github.com/MikeMcl/decimal.js/issues/9#issuecomment-441381356