Some platforms set errno on pow(), exp() overflow, some do not, so if

isinf(), fall through to our own infinity checks.
This commit is contained in:
Bruce Momjian 2007-01-02 22:19:42 +00:00
parent 09d09b988d
commit 182676ae27
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.134 2007/01/02 21:25:50 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.135 2007/01/02 22:19:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1444,7 +1444,7 @@ dpow(PG_FUNCTION_ARGS)
*/
errno = 0;
result = pow(arg1, arg2);
if (errno != 0)
if (errno != 0 && !isinf(result))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("result is out of range")));
@ -1469,7 +1469,7 @@ dexp(PG_FUNCTION_ARGS)
*/
errno = 0;
result = exp(arg1);
if (errno != 0)
if (errno != 0 && !isinf(result))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("result is out of range")));