aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 02:55:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 02:55:03 +0000
commitbdebd65c50e96d9034e89d777a2213a99fd28d18 (patch)
tree8b373152fde59802bafa8653f5f6d9d33b944edf /test/ruby
parent215b33e5bfeb264c3ee3f7d05bd0c742fc48ff65 (diff)
downloadruby-bdebd65c50e96d9034e89d777a2213a99fd28d18.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.rb3
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