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

attempting to invert a number runs out of memory #58

Closed
shekenahglory opened this issue Mar 24, 2015 · 2 comments
Closed

attempting to invert a number runs out of memory #58

shekenahglory opened this issue Mar 24, 2015 · 2 comments

Comments

@shekenahglory
Copy link

new BigNumber('0.50000025000012500006').pow(-1).toString()

this should work right? trying to invert the number.

after about 15 seconds I get:
FATAL ERROR: JS Allocation failed - process out of memory
Abort trap: 6

on node.js, version 2.0.3

@shekenahglory
Copy link
Author

same error for new BigNumber(1).dividedBy('0.50000025000012500006').toString();

MikeMcl added a commit that referenced this issue Mar 25, 2015
Due to using base 1e14 and the consequent imprecision of the trial digit calculation, in very rare circumstances the trial digit may be 2 less than the correct value, not just 1 as previously thought.
@MikeMcl
Copy link
Owner

MikeMcl commented Mar 25, 2015

Fixed in v2.0.4 by 3c24e50.

It was a critical and disappointing bug in the division operation, affecting all 2.x.x versions.

Thanks very much for the report.

MikeMcl added a commit that referenced this issue Mar 25, 2015
MikeMcl added a commit that referenced this issue Mar 25, 2015
MikeMcl added a commit that referenced this issue Mar 25, 2015
Due to using base 1e14 and the consequent imprecision of the trial digit calculation, in very rare circumstances the trial digit may be 2 less than the correct value, not just 1 as previously thought.
@MikeMcl MikeMcl closed this as completed Mar 29, 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