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

Commitf0f4a6d

Browse files
committed
Apply fix so pow() and exp() ERANGE is used only if result is not 0.
1 parent282f7f2 commitf0f4a6d

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.145 2007/01/0615:18:02 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.146 2007/01/0620:21:29 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1459,7 +1459,7 @@ dpow(PG_FUNCTION_ARGS)
14591459
else
14601460
result=1;
14611461
}
1462-
elseif (errno==ERANGE&& !isinf(result))
1462+
elseif (errno==ERANGE&&result!=0&&!isinf(result))
14631463
result=get_float8_infinity();
14641464

14651465
CHECKFLOATVAL(result,isinf(arg1)||isinf(arg2),arg1==0);
@@ -1478,7 +1478,7 @@ dexp(PG_FUNCTION_ARGS)
14781478

14791479
errno=0;
14801480
result=exp(arg1);
1481-
if (errno==ERANGE&& !isinf(result))
1481+
if (errno==ERANGE&&result!=0&&!isinf(result))
14821482
result=get_float8_infinity();
14831483

14841484
CHECKFLOATVAL(result,isinf(arg1), false);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp