summaryrefslogtreecommitdiff
path: root/test/ruby/test_math.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_math.rb')
-rw-r--r--test/ruby/test_math.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
index c4d0ff93f2..4efed1b094 100644
--- a/test/ruby/test_math.rb
+++ b/test/ruby/test_math.rb
@@ -239,6 +239,10 @@ class TestMath < Test::Unit::TestCase
end
assert_raise(Math::DomainError) { Math.gamma(-Float::INFINITY) }
+ x = Math.gamma(-0.0)
+ mesg = "Math.gamma(-0.0) should be -INF"
+ assert_infinity(x, mesg)
+ assert_operator(x, :<, 0, mesg)
end
def test_lgamma
@@ -281,6 +285,11 @@ class TestMath < Test::Unit::TestCase
assert_equal(s, 1)
assert_raise(Math::DomainError) { Math.lgamma(-Float::INFINITY) }
+ x, sign = Math.lgamma(-0.0)
+ mesg = "Math.lgamma(-0.0) should be [INF, -1]"
+ assert_infinity(x, mesg)
+ assert_operator(x, :>, 0, mesg)
+ assert_equal(-1, sign, mesg)
end
def test_cbrt