-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Expected Behavior
2.6.4 :001 > require 'bigdecimal/util'
=> true
2.6.4 :002 > 0.1.to_d
=> 0.1e0
3.1.3 :001 > require 'bigdecimal/util'
=> true
3.1.3 :002 > 0.1.to_d
=> 0.1e0
jruby-9.3.10.0 :001 > require 'bigdecimal/util'
=> true
jruby-9.3.10.0 :002 > 0.1.to_d
=> 0.1e0
Actual Behavior
jruby-9.4.1.0 :002 > require 'bigdecimal/util'
=> true
jruby-9.4.1.0 :003 > 0.1.to_d
=> 0.1000000000000000055511151231257827021181583404541015625e0
I understand that this is what you get with floating point arithmetic and that jruby-9.4 might be even more precise. But did this have to change in jruby-9.4? It leads to lower precision with basic calculations like 0.1.to_d - 0.1 which is not easy to understand for many users.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels