Skip to content

Commit 19ce06b

Browse files
committed
Improve dpow() check for ERANGE overflow for HPPA.
1 parent b2965b9 commit 19ce06b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/backend/utils/adt/float.c

Lines changed: 4 additions & 5 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.143 2007/01/06 02:28:38 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.144 2007/01/06 04:14:55 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1459,10 +1459,9 @@ dpow(PG_FUNCTION_ARGS)
14591459
else
14601460
result = 1;
14611461
}
1462-
else if (errno == ERANGE)
1463-
{
1464-
result = (arg1 >= 0) ? get_float8_infinity() : -get_float8_infinity();
1465-
}
1462+
/* Some platoforms, e.g. HPPA, return ERANGE, but HUGE_VAL, not Inf */
1463+
else if (errno == ERANGE && !isinf(result))
1464+
result = get_float8_infinity();
14661465

14671466
CHECKFLOATVAL(result, isinf(arg1) || isinf(arg2), arg1 == 0);
14681467
PG_RETURN_FLOAT8(result);

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