summaryrefslogtreecommitdiff
path: root/missing/lgamma_r.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-06 05:53:03 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-06 05:53:03 +0000
commitd1cd806372d04675e9f646f1c1e01ef97e103ecc (patch)
treed6cfec215d6194c81d652da0ddad654474dfc1eb /missing/lgamma_r.c
parentd2797c33bd41382c7dd6dbccdb4f2b08044d0cf9 (diff)
* missing/lgamma_r.c (loggamma): return 0 for 1 and 2.
* test/ruby/test_math.rb: accept errors by functions under missing/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing/lgamma_r.c')
-rw-r--r--missing/lgamma_r.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c
index ab6c28294a..ae93d078cb 100644
--- a/missing/lgamma_r.c
+++ b/missing/lgamma_r.c
@@ -34,6 +34,8 @@ loggamma(double x) /* the natural logarithm of the Gamma function. */
{
double v, w;
+ if (x == 1.0 || x == 2.0) return 0.0;
+
v = 1;
while (x < N) { v *= x; x++; }
w = 1 / (x * x);