diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 17:05:31 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 17:05:31 +0000 |
commit | 7fc9c4a4a0660b05edcfa1f92fef416bc3dcb49d (patch) | |
tree | 0ac51273ad261916de64e100abe15d09470c39bf /test | |
parent | 7785612a384d7582dedbf4419917c821ad30ed95 (diff) | |
download | ruby-7fc9c4a4a0660b05edcfa1f92fef416bc3dcb49d.tar.gz |
* numeric.c (flo_cmp): Infinity is greater than any bignum
number. [ruby-dev:38672]
* bignum.c (rb_big_cmp): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_float.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 96fd354aba..15e17ad92a 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -215,6 +215,11 @@ class TestFloat < Test::Unit::TestCase assert_equal(-1, 1.0 <=> 2**32) + assert_equal(1, inf <=> (Float::MAX.to_i*2)) + assert_equal(-1, -inf <=> (-Float::MAX.to_i*2)) + assert_equal(-1, (Float::MAX.to_i*2) <=> inf) + assert_equal(1, (-Float::MAX.to_i*2) <=> -inf) + assert_raise(ArgumentError) { 1.0 > nil } assert_raise(ArgumentError) { 1.0 >= nil } assert_raise(ArgumentError) { 1.0 < nil } |