Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 269795

Summary: dev-lang/ruby-1.8.6_p368: eval "0.0/0.0": warning: Float 0.0 out of range
Product: Gentoo Linux Reporter: Pavel Suchmann <pavel.suchmann>
Component: [OLD] DevelopmentAssignee: Gentoo Ruby Team <ruby>
Status: RESOLVED FIXED    
Severity: minor CC: pavel.suchmann
Priority: Low    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Pavel Suchmann 2009-05-14 08:21:29 UTC
I have observed a suspicious warning in 1.8.6.368 when evaluating NaN immediately after Infinity:

$ ruby -vwe 'Math::exp Math::exp(42); eval "0.0/0.0"'
ruby 1.8.6 (2009-03-31 patchlevel 368) [i686-linux]
(eval):1: warning: Float 0.0 out of range

Without reaching Infinity first, there is no such warning produced:

$ ruby -vwe 'eval "0.0/0.0"'
ruby 1.8.6 (2009-03-31 patchlevel 368) [i686-linux]

It seems an older patchlevel of 1.8.6 behaves differently:

$ ruby -vwe 'Math::exp Math::exp(42); eval "0.0/0.0"'
ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]

The 1.9 version of ruby remains silent as well (which is imho correct behavior):

$ ruby -vwe 'Math::exp Math::exp(42); eval "0.0/0.0"'
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

Am I missing something?
Comment 1 Hans de Graaff gentoo-dev Security 2009-05-14 09:00:26 UTC
This is already broken in ruby 1.8.6 pl 287:

ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
(eval):1: warning: Float 0.0 out of range
Comment 2 Hans de Graaff gentoo-dev Security 2010-08-08 11:05:43 UTC
This appears to be fixed in p299, so I'm closing this bug:

$ruby -vwe 'Math::exp Math::exp(42); eval "0.0/0.0"'
ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]