|
From: Ethan M. <merritt@u.washington.edu> - 2006-09-28 21:41:09
|
On Thursday 28 September 2006 02:30 pm, Daniel J Sebald wrote: > > I'm not so certain we have shown that it is broken. My point is that > signgam has no relation to lgamma() anymore in the context of C99. You are spouting nonsense. ISO/IEC C99 (including Annex F, "IEC 60559 floating-point arithmetic") and POSIX 2001 (IEEE Std 1003.1:2001) require lgamma() to provide signgam as an extern int I quote from the document "Rationale for International Standard Programming Languages C Revision 5.10 April-2003" 7.12.8.3 The lgamma functions New feature for C99. Since the mathematical gamma function increases in value so quickly (it is around 10306 for an argument of only 170), the logarithm of gamma extends the useful domain. Also, for computing combinations and permutations, it is the quotient of the (potentially large) gammas that is needed; taking differences of the lgammas instead allows for calculations without overflow. In Single Unix, a call to lgamma sets an external variable, signgam, to the sign of gamma(x), which is 1 if x < 0 && remainder(floor(x), 2) != 0. Note that this specification does not remove the external identifier signgam from the user's name space. An implementation that supports lgamma's setting of signgam as an extension must still protect the external identifier signgam if defined by the user. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle WA |