summaryrefslogtreecommitdiff
path: root/test/ruby/test_complex.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 13:58:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 13:58:52 +0000
commit3bcb10ad2a11f60ec8458ad24f64b0ec97a816cc (patch)
treee1dbae865f6e785771dd2bb93bf34cd5eebedfb7 /test/ruby/test_complex.rb
parent87e3aec84d13f179fe56a24243baf0f9b55ac87c (diff)
complex.c: multiply as rotation
* complex.c (nucomp_mul): calculate as rotation in complex plane if matrix calculation resulted in NaN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_complex.rb')
-rw-r--r--test/ruby/test_complex.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index 1cbab2d834..3625eb97a5 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -289,6 +289,13 @@ class Complex_Test < Test::Unit::TestCase
assert_equal(Complex(Rational(2,1),Rational(4)), c * Rational(2))
assert_equal(Complex(Rational(2,3),Rational(4,3)), c * Rational(2,3))
+
+ c = Complex(Float::INFINITY, 0)
+ assert_equal(Complex(Float::INFINITY, 0), c * Complex(1, 0))
+ assert_equal(Complex(0, Float::INFINITY), c * Complex(0, 1))
+ c = Complex(0, Float::INFINITY)
+ assert_equal(Complex(0, Float::INFINITY), c * Complex(1, 0))
+ assert_equal(Complex(-Float::INFINITY, 0), c * Complex(0, 1))
end
def test_div