Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a252994

Browse files
committed
Simplify assignment of Inf for pow Nan (don't worry about the sign).
1 parent eeb2189 commit a252994

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/utils/adt/float.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.139 2007/01/03 22:05:00 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.140 2007/01/04 05:18:39 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1453,7 +1453,8 @@ dpow(PG_FUNCTION_ARGS)
14531453
if (errno == EDOM && isnan(result))
14541454
{
14551455
if ((fabs(arg1) > 1 && arg2 >= 0) || (fabs(arg1) < 1 && arg2 < 0))
1456-
result = (arg1 >= 0) ? get_float8_infinity() : -get_float8_infinity();
1456+
/* The sign if Inf is not significant in this case. */
1457+
result = get_float8_infinity();
14571458
else if (fabs(arg1) != 1)
14581459
result = 0;
14591460
else

0 commit comments

Comments
 (0)