aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_math.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-05 15:53:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-05 15:53:32 +0000
commitb2b1125dcef8a982a87b53ea334d5f762d444fbc (patch)
tree13a7819ea90591e0ce8c9fbc388f94242a74fd87 /test/ruby/test_math.rb
parente9fafd82f0e0906c53b216df3646f2dd91e7ddb3 (diff)
downloadruby-b2b1125dcef8a982a87b53ea334d5f762d444fbc.tar.gz
math.c: fix lgamma
* math.c (ruby_lgamma_r): fix lgamma(-0.0) on mingw and OSX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_math.rb')
-rw-r--r--test/ruby/test_math.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
index c17b21a53d..1d571252ee 100644
--- a/test/ruby/test_math.rb
+++ b/test/ruby/test_math.rb
@@ -275,6 +275,11 @@ class TestMath < Test::Unit::TestCase
assert_float_and_int([Math.log(6), 1], Math.lgamma(4))
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_predicate(x, :positive?, mesg)
+ assert_equal(-1, sign, mesg)
end
def test_fixnum_to_f