mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
Simplify assignment of Inf for pow Nan (don't worry about the sign).
This commit is contained in:
parent
eeb2189112
commit
a252994abe
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.139 2007/01/03 22:05:00 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.140 2007/01/04 05:18:39 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1453,7 +1453,8 @@ dpow(PG_FUNCTION_ARGS)
|
||||
if (errno == EDOM && isnan(result))
|
||||
{
|
||||
if ((fabs(arg1) > 1 && arg2 >= 0) || (fabs(arg1) < 1 && arg2 < 0))
|
||||
result = (arg1 >= 0) ? get_float8_infinity() : -get_float8_infinity();
|
||||
/* The sign if Inf is not significant in this case. */
|
||||
result = get_float8_infinity();
|
||||
else if (fabs(arg1) != 1)
|
||||
result = 0;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user