diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-30 08:23:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-30 08:23:40 +0000 |
commit | 767fe5170d97461be5c79936b467dee3d4eb7179 (patch) | |
tree | e2bb64fac1f3a143f7e96b84358dbe4fa9775da8 /test | |
parent | bd7daa5ac5923692eb145d8f989efde689101d00 (diff) |
* util.c (ruby_strtod): get rid of overflow/underflow as possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_float.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index dd61f1919b..7ab4ffc649 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -102,7 +102,14 @@ class TestFloat < Test::Unit::TestCase assert_equal(0.0009765625, Float("0x1p-10")) assert_equal(2.6881171418161356e+43, Float("0x1.3494a9b171bf5p+144")) assert_equal(-3.720075976020836e-44, Float("-0x1.a8c1f14e2af5dp-145")) - + assert_equal(31.0*2**1019, Float("0x0."+("0"*268)+"1fp2099")) + assert_equal(31.0*2**1019, Float("0x0."+("0"*600)+"1fp3427")) + assert_equal(-31.0*2**1019, Float("-0x0."+("0"*268)+"1fp2099")) + assert_equal(-31.0*2**1019, Float("-0x0."+("0"*600)+"1fp3427")) + assert_equal(31.0*2**-1027, Float("0x1f"+("0"*268)+".0p-2099")) + assert_equal(31.0*2**-1027, Float("0x1f"+("0"*600)+".0p-3427")) + assert_equal(-31.0*2**-1027, Float("-0x1f"+("0"*268)+".0p-2099")) + assert_equal(-31.0*2**-1027, Float("-0x1f"+("0"*600)+".0p-3427")) end def test_divmod |