Project

General

Profile

Backport #3362

rb_big2dbl incorrectly returns Infinity for a negative Bignum out of range of a double

Added by brixen (Brian Shirai) over 9 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:30492]

Description

=begin
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.

Thanks,
Brian
=end

Associated revisions

Revision c0ec23d1
Added by mrkn (Kenta Murata) over 9 years ago

  • 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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 1acfb033
Added by shyouhei (Shyouhei Urabe) over 7 years ago

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35941
Added by shyouhei (Shyouhei Urabe) over 7 years ago

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]

History

#1

Updated by shyouhei (Shyouhei Urabe) over 9 years ago

  • Status changed from Open to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin
Yes there'll be another 1.8.7 release. I'll backport it later.
=end

#2

Updated by shyouhei (Shyouhei Urabe) over 9 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]

=begin
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
Infinity

=end

#3

Updated by shyouhei (Shyouhei Urabe) over 9 years ago

  • Assignee changed from shyouhei (Shyouhei Urabe) to mrkn (Kenta Murata)

=begin

=end

#4

Updated by mrkn (Kenta Murata) over 9 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r28324.
Brian, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

#5

Updated by naruse (Yui NARUSE) almost 8 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby 1.8 to Backport187
  • Status changed from Closed to Assigned
  • Assignee changed from mrkn (Kenta Murata) to shyouhei (Shyouhei Urabe)
  • Target version deleted (Ruby 1.8.8)
#6

Updated by shyouhei (Shyouhei Urabe) over 7 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]

Also available in: Atom PDF