diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-27 03:51:56 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-27 03:51:56 +0000 |
commit | 9be503f332515719475216e7788e6a7fab6c78d0 (patch) | |
tree | 4c9a9b32d33742b525282b7cfbcebd6b9a762aea /test/ruby/test_math.rb | |
parent | f64358db7d5f9991bd2c8f6f382ee32767a1c26a (diff) |
* math.c (math_atan2): change the behavior when x and y are zero.
* test/ruby/test_math.rb (test_atan2): add tests for the above
changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_math.rb')
-rw-r--r-- | test/ruby/test_math.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index 64b72ce5c0..3895eec7f5 100644 --- a/test/ruby/test_math.rb +++ b/test/ruby/test_math.rb @@ -17,7 +17,10 @@ class TestMath < Test::Unit::TestCase end def test_atan2 - assert_raise(Math::DomainError) { Math.atan2(0, 0) } + check(+0.0, Math.atan2(+0.0, +0.0)) + check(-0.0, Math.atan2(-0.0, +0.0)) + check(+Math::PI, Math.atan2(+0.0, -0.0)) + check(-Math::PI, Math.atan2(-0.0, -0.0)) assert_raise(Math::DomainError) { Math.atan2(Float::INFINITY, Float::INFINITY) } assert_raise(Math::DomainError) { Math.atan2(Float::INFINITY, -Float::INFINITY) } assert_raise(Math::DomainError) { Math.atan2(-Float::INFINITY, Float::INFINITY) } |