-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
[bigdecimal] Loss of precision with different execution order #2524
Comments
That looks like an error with how many decimal places are being stored. I tried: r3 = r1.round(200)
=> #<BigDecimal:761257ea,'0.65068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493E0',200(204)>
r4 = r2.round(200)
=> #<BigDecimal:acaf0ac,'0.65068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493150684931506849315068493E0',200(204)>
r3 == r4
=> true The 201st decimal place seems to be where it breaks. |
Thank you, awesome! |
@enebo this still doesn't work on current jruby-1_7. Should I open a different PR against jruby-1_7? Thank you. |
@k77ch7 If you are unable to make a new PR I can try and cherry-pick this but it is simpler if you make a new PR |
@k77ch7 1.9+ bugs are a little simpler for us to merge if the PR is submitted to jruby-1_7 first. |
@enebo Thanks for your quick response. |
Depending on the order of calculation I get different results that should be equal:
I could reproduce this with both
and
Thanks for your great work on 9000 btw!
The text was updated successfully, but these errors were encountered: