1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* complex.c (numeric_abs2): new.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2008-08-31 11:51:04 +00:00
parent 8aae9dc62c
commit 1d9a079b1c
4 changed files with 22 additions and 2 deletions

View file

@ -856,6 +856,11 @@ class Complex_Test < Test::Unit::TestCase
assert_equal(1, 1.0.magnitude)
assert_equal(1, -1.0.magnitude)
assert_equal(4, 2.abs2)
assert_equal(4, -2.abs2)
assert_equal(4.0, 2.0.abs2)
assert_equal(4.0, -2.0.abs2)
assert_equal(0, 1.arg)
assert_equal(0, 1.angle)
assert_equal(0, 1.phase)