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

15 digit limitation can be wrong #84

Closed
1simonfish opened this issue Dec 9, 2015 · 1 comment
Closed

15 digit limitation can be wrong #84

1simonfish opened this issue Dec 9, 2015 · 1 comment

Comments

@1simonfish
Copy link

I found issue #11, referring to the 15 digit limit.

x = new BigNumber(Number.MAX_SAFE_INTEGER)

should be legal. We're using BigNumber as a replacement for BigInteger, and having to convert legal integers to strings just to convert them to BigNumbers is inefficient. Surely there's a more efficient way to do this?

@MikeMcl
Copy link
Owner

MikeMcl commented Dec 10, 2015

I've nothing to add to the very long reply I gave in #11. The following will prevent the error.

// There's little reason to have ERRORS true unless debugging
BigNumber.config({ ERRORS: false });

Also, any non-integers or large integers are converted to a string anyway by the BigNumber constructor before the value is parsed, so there is no real inefficiency introduced anyway.

Edit:
From v2.2.0, all integers up to Number.MAX_SAFE_INTEGER are now accepted.

@MikeMcl MikeMcl closed this as completed Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants