-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Description
Hi,
I noticed there's a loss in precision when using 1.7.19. This is fixed in 9000.
I thought it'd be a good idea to report this anyways.
1.7.19:
$ ruby -v
jruby 1.7.19 (2.0.0p598) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17 +jit [darwin-x86_64]
$ irb
>> require 'bigdecimal'
=> true
>> BigDecimal.new("10.9", 2).to_f
=> 11.0
9.0.0.0.pre1:
$ ruby -v
jruby 9.0.0.0.pre1 (2.2.0p0) 2015-01-20 d537cab Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]
$ irb
>> require 'bigdecimal'
=> true
>> BigDecimal.new("10.9", 2).to_f
=> 10.9
MRI 2.2.0:
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
$ irb
>> require 'bigdecimal'
=> true
>> BigDecimal.new("10.9", 2).to_f
=> 10.9
I'm running this on mac using OS X 10.10.2 and the JVM:
$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Reactions are currently unavailable