Cygwin: math: Fix the return value for tgammal for zero and negative integers
For zero, it should return HUGE_VAL (INFINITY), for negative integers, it should return NAN. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
b99887c428
commit
f4e7849fa9
@ -285,6 +285,9 @@ long double __tgammal_r(long double x, int* sgngaml)
|
|||||||
return (x);
|
return (x);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
if (x == 0.0L)
|
||||||
|
return copysignl(HUGE_VALL, x);
|
||||||
|
|
||||||
q = fabsl(x);
|
q = fabsl(x);
|
||||||
|
|
||||||
if (q > 13.0L)
|
if (q > 13.0L)
|
||||||
@ -299,8 +302,8 @@ long double __tgammal_r(long double x, int* sgngaml)
|
|||||||
gsing:
|
gsing:
|
||||||
_SET_ERRNO(EDOM);
|
_SET_ERRNO(EDOM);
|
||||||
mtherr("tgammal", SING);
|
mtherr("tgammal", SING);
|
||||||
#ifdef INFINITIES
|
#ifdef NANS
|
||||||
return (INFINITYL);
|
return (NAN);
|
||||||
#else
|
#else
|
||||||
return (*sgngaml * MAXNUML);
|
return (*sgngaml * MAXNUML);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user