rb_big2dbl incorrectly returns Infinity for a negative Bignum out of range of a double
Revision 12261 changed rb_big2dbl in a way that caused a negative Bignum out of range of a double to be returned as Infinity rather than -Infinity. This was a regression that appears to be fixed in 1.9 but is still present in 1.8.7p249.
Could a fix for this be backported to 1.8.7 or are no further 1.8.7 versions being released? Also, the bug is still in http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8 so would presumably appear an a 1.8.8 release.
Updated by shyouhei (Shyouhei Urabe) about 10 years ago
- Target version set to Ruby 1.8.8
- ruby -v set to ruby 1.8.8dev (2010-06-08 revision 27061) [x86_64-linux]
zsh % ~/target/ruby_1_8/bin/ruby -ve'p (-1 << 65536).to_f'
ruby 1.8.8dev (2010-06-08 revision 27061) [x86_64-linux]
-e:1: warning: (...) interpreted as grouped expression
-e:1: warning: Bignum out of Float range
Updated by shyouhei (Shyouhei Urabe) about 8 years ago
- Status changed from Assigned to Closed
This issue was solved with changeset r35941.
Brian, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 28324:
* bignum.c (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f):
A negative Bignum out of Float range should be converted to -Infinity.
[ruby-core:30492] [Bug #3362]