diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 02:38:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 02:38:51 +0000 |
commit | 241ba38d7007ca64a2e18b8422b18a9988eeab3e (patch) | |
tree | 418f4554975429beaa0bafadc986e88b7facc091 /test | |
parent | 9eed577cf5e85fe0f62eb1c2b964e847e62c2612 (diff) | |
download | ruby-241ba38d7007ca64a2e18b8422b18a9988eeab3e.tar.gz |
complex.c: no overflow
* complex.c (rb_complex_finite_p): get rid of overflow and
unnecessary multiplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 5707047338..6a67f84bf5 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -832,6 +832,9 @@ class Complex_Test < Test::Unit::TestCase assert_predicate(-1-1i, :finite?) assert_not_predicate(Float::INFINITY + 1i, :finite?) assert_not_predicate(Complex(1, Float::INFINITY), :finite?) + assert_predicate(Complex(Float::MAX, 0.0), :finite?) + assert_predicate(Complex(0.0, Float::MAX), :finite?) + assert_predicate(Complex(Float::MAX, Float::MAX), :finite?) end def test_infinite_p |