From 8ce6c0265b6f788d5e20c24ba69dfd802c7c1b08 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 6 Mar 2008 05:53:03 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@15708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/lgamma_r.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'missing/lgamma_r.c') diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c index ab6c28294..ae93d078c 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); -- cgit