mirror of
https://github.com/postgres/postgres.git
synced 2026-06-10 17:20:31 -04:00
Work around lgamma(NaN) bug on AIX.
lgamma(NaN) should produce NaN, but on older versions of AIX it reports an ERANGE error. While that's been fixed in the latest version of libm, it'll take awhile for the fix to propagate. This workaround is harmless even when the underlying bug does get fixed. Discussion: https://postgr.es/m/3603369.1771877682@sss.pgh.pa.us
This commit is contained in:
parent
aca61f7e5f
commit
d743545d84
1 changed files with 6 additions and 0 deletions
|
|
@ -2852,6 +2852,12 @@ dlgamma(PG_FUNCTION_ARGS)
|
|||
float8 arg1 = PG_GETARG_FLOAT8(0);
|
||||
float8 result;
|
||||
|
||||
/* On some versions of AIX, lgamma(NaN) fails with ERANGE */
|
||||
#if defined(_AIX)
|
||||
if (isnan(arg1))
|
||||
PG_RETURN_FLOAT8(arg1);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Note: lgamma may not be thread-safe because it may write to a global
|
||||
* variable signgam, which may not be thread-local. However, this doesn't
|
||||
|
|
|
|||
Loading…
Reference in a new issue