diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 02:55:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 02:55:03 +0000 |
commit | 65d7479920d1bc94a25dbd759bb573c7b88c9fe1 (patch) | |
tree | 8b373152fde59802bafa8653f5f6d9d33b944edf /test/ruby | |
parent | 241ba38d7007ca64a2e18b8422b18a9988eeab3e (diff) | |
download | ruby-65d7479920d1bc94a25dbd759bb573c7b88c9fe1.tar.gz |
complex.c: no overflow
* complex.c (rb_complex_infinite_p): get rid of overflow and
unnecessary multiplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_complex.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 6a67f84bf5..ab6aaa0d9c 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -850,6 +850,9 @@ class Complex_Test < Test::Unit::TestCase assert_equal(1, Complex(-1, Float::INFINITY).infinite?) assert_equal(1, Complex(1, -Float::INFINITY).infinite?) assert_equal(1, Complex(-1, -Float::INFINITY).infinite?) + assert_nil(Complex(Float::MAX, 0.0).infinite?) + assert_nil(Complex(0.0, Float::MAX).infinite?) + assert_nil(Complex(Float::MAX, Float::MAX).infinite?) end def test_supp |