Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this version generate infinite precision if the precision is not specified? #1

Open
kaue opened this issue Nov 24, 2018 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@kaue
Copy link
Owner

kaue commented Nov 24, 2018

Issue reported at MikeMcl/decimal.js#9 (comment)

@kaue
Copy link
Owner Author

kaue commented Nov 24, 2018

@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?

@calidion
Copy link

Is it the maximum precision?

@calidion
Copy link

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

@kaue
Copy link
Owner Author

kaue commented Nov 24, 2018

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?

@calidion
Copy link

Can the precision be dynamic?

@kaue
Copy link
Owner Author

kaue commented Nov 24, 2018

Not sure

@calidion
Copy link

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.

@kaue
Copy link
Owner Author

kaue commented Nov 24, 2018

@calidion I don't have time to make big changes to this package, but feel free to create a PR if you want to.

@calidion
Copy link

OK.

@kaue kaue added the help wanted Extra attention is needed label Nov 24, 2018
@kaue
Copy link
Owner Author

kaue commented Dec 2, 2018

@calidion any progress on this? ;)

@calidion
Copy link

calidion commented Dec 3, 2018

Sorry, I don't have time currently.

@kaue
Copy link
Owner Author

kaue commented Dec 4, 2018

Oh, no problem. i hope we can add stuff to this package in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants