Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.6.7
-
Component/s: Application Error
-
Environment:Linux WW637V18660A 2.6.32-37-generic-pae #81-Ubuntu
-
Number of attachments :
Description
JRuby 1.6.7 is not returning the correct result when 'Math.log10(1000)' is executed. See code snippet below:
$ irb
jruby-1.6.7 :001 > Math.log10(1000)
=> 2.9999999999999996
What should be returned is in fact 3.0.
The same calculation performed using other variants of JRuby below...
JRuby 1.6.4:
jruby-1.6.4 :002 > Math.log10(1000)
=> 3.0
JRuby 1.6.5:
jruby-1.6.5 :001 > Math.log10(1000)
=> 3.0
System details below...
$ rvm info
jruby-1.6.7@j2oomee:
system:
uname: "Linux WW637V18660A 2.6.32-37-generic-pae #81-Ubuntu SMP Fri Dec 2 22:24:22 UTC 2011 i686 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "jruby"
version: "1.6.7"
date: "2012-02-22"
platform: "linux-i386-java"
patchlevel: "TM"
full_version: "jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) Server VM 1.6.0_22) [linux-i386-java]"
homes:
gem: "/home/drathbon/.rvm/gems/jruby-1.6.7@j2oomee"
ruby: "/home/drathbon/.rvm/rubies/jruby-1.6.7"
binaries:
ruby: "/home/drathbon/.rvm/rubies/jruby-1.6.7/bin/ruby"
irb: "/home/drathbon/.rvm/rubies/jruby-1.6.7/bin/irb"
gem: "/home/drathbon/.rvm/rubies/jruby-1.6.7/bin/gem"
rake: "/home/drathbon/.rvm/gems/jruby-1.6.7@j2oomee/bin/rake"
Issue Links
- relates to
-
JRUBY-4846
1.9: Float#to_s has changed
-
The values are the same, but we are displaying the result with greater precision in the 1.9 mode, and now we are seeing the shortcomings of the floating point arithmetic.
There is no format that we can specify which satisfies both this and the test case shown in
JRUBY-4846(1.1 -0.9). So, I am not sure what we can do here.