math.c: fix tgamma

* math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
  [ruby-core:74817] [Bug #12249]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-04-05 15:52:02 +00:00
parent a491508753
commit 41c533446f
3 changed files with 19 additions and 4 deletions

View file

@ -255,6 +255,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_predicate(x, :negative?, mesg)
end
def test_lgamma