Commit a252994a authored by Bruce Momjian's avatar Bruce Momjian

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

parent eeb21891
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -1453,7 +1453,8 @@ dpow(PG_FUNCTION_ARGS)
if (errno == EDOM && isnan(result)) if (errno == EDOM && isnan(result))
{ {
if ((fabs(arg1) > 1 && arg2 >= 0) || (fabs(arg1) < 1 && arg2 < 0)) 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) else if (fabs(arg1) != 1)
result = 0; result = 0;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment