1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 04:40:59 +01:00

31902: rationalise use of gamma function.

Make zsh/mathfunc consistent across systems and use tgamma() where
available
This commit is contained in:
Jun T 2013-10-27 00:41:03 +09:00 committed by Peter Stephenson
parent 7a79f660db
commit ef4d20ad6f
5 changed files with 22 additions and 2 deletions

View file

@ -340,7 +340,16 @@ math_func(char *name, int argc, mnumber *argv, int id)
break;
case MF_GAMMA:
#ifdef HAVE_TGAMMA
retd = tgamma(argd);
#else
#ifdef HAVE_SIGNGAM
retd = lgamma(argd);
retd = signgam*exp(retd);
#else /*XXX assume gamma(x) returns Gamma(x), not log(|Gamma(x)|) */
retd = gamma(argd);
#endif
#endif
break;
case MF_HYPOT: