mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
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
This commit is contained in:
parent
87e3aec84d
commit
3bcb10ad2a
3 changed files with 47 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue