|
From: Daniel J S. <dan...@ie...> - 2006-09-30 09:14:39
|
Hans-Bernhard Br=F6ker wrote: >>I still haven't seen anything that specifically calls out that in C99 >>lgamma() must or should support signgam. >=20 >=20 > That's because it's not there. I stated this as fact from memory, but=20 > it turned out to be wrong on re-reading the document. OK... Well, the autoconf for running a program really wasn't too bad. For thos= e interested: dnl check, if gamma is log of gamma. if program dnl compiles and gamma(2.0) < 0.5 is false, then dnl simply say "gamma is gamma", otherwise define dnl GAMMA_IS_LNGAMMA AC_LANG(C) AC_RUN_IFELSE( [AC_LANG_PROGRAM([#include <math.h>],[exit(gamma(2.0) < 0.5);])], [ echo "gamma is gamma" ], [AC_DEFINE(GAMMA_IS_LGAMMA,1,[ Define if gamma() present and is log gamma= ])] ) I mildly suggest the most recent patch be added for 4.2. I think it is e= asier to simply add this patch than it is to explain the gamma-was-once-n= at-log-gamma confusion to a package or software maintainer. There is a g= ood chance, I think, someone will get bit by this, and we'd be saving him= or her a lot of time and headache. It's a very straightforward patch now... on SourceForge. Dan PS: I've verified this by slowly stripping away definition precedence, i= .e., #undef HAVE_TGAMMA, #undef HAVE_LGAMMA_R, #undef HAVE_GAMMA, etc. |