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:
parent
7a79f660db
commit
ef4d20ad6f
5 changed files with 22 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue