From c0ec23d127a7a5f78b250196bae2fb891e668e96 Mon Sep 17 00:00:00 2001 From: mrkn Date: Tue, 15 Jun 2010 01:47:19 +0000 Subject: * 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 --- test/ruby/test_bignum.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 99c5952173..a0405ca274 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -103,4 +103,10 @@ class TestBignum < Test::Unit::TestCase e = assert_raise(RangeError) {(1 << big).to_s} assert_match(/too big to convert/, e.message) end + + def test_to_f + inf = 1 / 0.0 + assert_equal(inf, (1 << 65536).to_f) + assert_equal(-inf, (-1 << 65536).to_f) # [ruby-core:30492] [Bug #3362] + end end -- cgit v1.2.3