From ripley@stats.ox.ac.uk  Wed Oct  4 13:12:12 2000
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Wed, 4 Oct 2000 14:12:12 +0200 (MET DST)
Subject: [Rd] gamma and lgamma functions (PR#684)
Message-ID: <200010041212.OAA14250@pubhealth.ku.dk>

> From: james.lindsey@luc.ac.be
> Date: Wed, 4 Oct 2000 13:59:14 +0200 (MET DST)
> 
> The following seems very strange:
> > lgamma(-0.04)
> [1] 3.243307
> > gamma(-0.04)
> [1] -25.61830
>   Jim

It is as documented, though: ?lgamma gives

     The functions `gamma' and `lgamma' return the gamma function
     Gamma(x) and the natural logarithm of the absolute value of the
                                               ^^^^^^^^^^^^^^^^^
     gamma function.

and log(25.61830) = 3.243307.

It's not S-compatible, I grant.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] gamma and lgamma functions (PR#684)
ripley@stats.ox.ac.uk