88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.144 2007/01/0604:14:55 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.145 2007/01/0615:18:02 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -1444,8 +1444,8 @@ dpow(PG_FUNCTION_ARGS)
14441444 * using errno. However, some platform/CPU combinations return
14451445 * errno == EDOM and result == Nan for negative arg1 and very large arg2
14461446 * (they must be using something different from our floor() test to
1447- * decide it's invalid). Other platforms return errno == ERANGE and a
1448- * large but finite result to signal overflow.
1447+ * decide it's invalid). Other platforms(HPPA) return errno == ERANGE
1448+ *and a large (HUGE_VAL) but finite result to signal overflow.
14491449 */
14501450errno = 0 ;
14511451result = pow (arg1 ,arg2 );
@@ -1459,7 +1459,6 @@ dpow(PG_FUNCTION_ARGS)
14591459else
14601460result = 1 ;
14611461}
1462- /* Some platoforms, e.g. HPPA, return ERANGE, but HUGE_VAL, not Inf */
14631462else if (errno == ERANGE && !isinf (result ))
14641463result = get_float8_infinity ();
14651464
@@ -1477,7 +1476,10 @@ dexp(PG_FUNCTION_ARGS)
14771476float8 arg1 = PG_GETARG_FLOAT8 (0 );
14781477float8 result ;
14791478
1479+ errno = 0 ;
14801480result = exp (arg1 );
1481+ if (errno == ERANGE && !isinf (result ))
1482+ result = get_float8_infinity ();
14811483
14821484CHECKFLOATVAL (result ,isinf (arg1 ), false);
14831485PG_RETURN_FLOAT8 (result );