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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy