diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-05 15:53:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-05 15:53:32 +0000 |
commit | 542d3a071f0cf5fd7488edcb11ab0472990e9bbf (patch) | |
tree | 13a7819ea90591e0ce8c9fbc388f94242a74fd87 /test | |
parent | 8c4c3508d9f63d1cebe60e3c7dd048003279fde3 (diff) |
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')
-rw-r--r-- | test/ruby/test_math.rb | 5 |
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 |