Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit182676a

Browse files
committed
Some platforms set errno on pow(), exp() overflow, some do not, so if
isinf(), fall through to our own infinity checks.
1 parent09d09b9 commit182676a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/adt/float.c

Lines changed: 3 additions & 3 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.134 2007/01/0221:25:50 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.135 2007/01/0222:19:42 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1444,7 +1444,7 @@ dpow(PG_FUNCTION_ARGS)
14441444
*/
14451445
errno=0;
14461446
result=pow(arg1,arg2);
1447-
if (errno!=0)
1447+
if (errno!=0&& !isinf(result))
14481448
ereport(ERROR,
14491449
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
14501450
errmsg("result is out of range")));
@@ -1469,7 +1469,7 @@ dexp(PG_FUNCTION_ARGS)
14691469
*/
14701470
errno=0;
14711471
result=exp(arg1);
1472-
if (errno!=0)
1472+
if (errno!=0&& !isinf(result))
14731473
ereport(ERROR,
14741474
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
14751475
errmsg("result is out of range")));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp