8000 Improve dpow() check for ERANGE overflow for HPPA. · postgrespro/postgres_cluster@19ce06b · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

8000
Appearance settings

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)
0