From 65d7479920d1bc94a25dbd759bb573c7b88c9fe1 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 27 Sep 2017 02:55:03 +0000 Subject: 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 --- test/ruby/test_complex.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') 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 -- cgit v1.2.1