Simplify assignment of Inf for pow Nan (don't worry about the sign).

This commit is contained in:
Bruce Momjian 2007-01-04 05:18:39 +00:00
parent eeb2189112
commit a252994abe

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.139 2007/01/03 22:05:00 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.140 2007/01/04 05:18:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1453,7 +1453,8 @@ dpow(PG_FUNCTION_ARGS)
if (errno == EDOM && isnan(result))
{
if ((fabs(arg1) > 1 && arg2 >= 0) || (fabs(arg1) < 1 && arg2 < 0))
result = (arg1 >= 0) ? get_float8_infinity() : -get_float8_infinity();
/* The sign if Inf is not significant in this case. */
result = get_float8_infinity();
else if (fabs(arg1) != 1)
result = 0;
else