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

Division not giving enough precision #133

Open
thecaligarmo opened this issue Apr 25, 2024 · 0 comments
Open

Division not giving enough precision #133

thecaligarmo opened this issue Apr 25, 2024 · 0 comments
Assignees

Comments

@thecaligarmo
Copy link

Describe the bug
Division is returning 0 for very small numbers

To Reproduce
The following returns a value of 0, when it shouldn't:

var one = new bigDecimal('200000000000')
var two = new bigDecimal('17453700000.00000000')
var three = new bigDecimal('273484570903.25196072045472431920336519131248')
console.log(one.divide(two).divide(three))

Expected behavior
This should give me a more precise decimal. In particular, it would be nice to have at least 4 (non-zero) values in the form of a.xyz E -1000000 or something like that. Or, allow some way to alter the precision when doing division with very small numbers.

Additional context
No additional context.

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