summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-28 17:42:32 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-28 17:42:32 +0000
commit78b5fdd5a88b001c7576f23df49ed6cdd030229e (patch)
tree9d098daf1252783b3195a9e79ffd3600eaa56c8b /test
parent54da95b9e1f25d02d1580578fdf21e7cf8001e31 (diff)
* math.c (math_atanh): raise EDOM on FreeBSD when atanh(1).
* math.c (math_log): ditto. * math.c (math_log2): ditto. * math.c (math_log10): ditto. * test/ruby/test_math.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_math.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
index 67f5e86e42..55f354664c 100644
--- a/test/ruby/test_math.rb
+++ b/test/ruby/test_math.rb
@@ -110,6 +110,7 @@ class TestMath < Test::Unit::TestCase
check(0, Math.log(1, 10))
check(1, Math.log(10, 10))
check(2, Math.log(100, 10))
+ assert_equal(1.0/0, Math.log(1.0/0))
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log(0) }
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log(-1) }
end
@@ -118,6 +119,7 @@ class TestMath < Test::Unit::TestCase
check(0, Math.log2(1))
check(1, Math.log2(2))
check(2, Math.log2(4))
+ assert_equal(1.0/0, Math.log2(1.0/0))
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log2(0) }
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log2(-1) }
end
@@ -126,6 +128,7 @@ class TestMath < Test::Unit::TestCase
check(0, Math.log10(1))
check(1, Math.log10(10))
check(2, Math.log10(100))
+ assert_equal(1.0/0, Math.log10(1.0/0))
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log10(0) }
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log10(-1) }
end
@@ -134,6 +137,7 @@ class TestMath < Test::Unit::TestCase
check(0, Math.sqrt(0))
check(1, Math.sqrt(1))
check(2, Math.sqrt(4))
+ assert_equal(1.0/0, Math.sqrt(1.0/0))
assert_raise(Errno::EDOM, Errno::ERANGE) { Math.sqrt(-1) }
end