mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 00:06:52 +02:00
Improve dpow() check for ERANGE overflow for HPPA.
This commit is contained in:
parent
b2965b9fce
commit
19ce06b91b
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.143 2007/01/06 02:28:38 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.144 2007/01/06 04:14:55 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1459,10 +1459,9 @@ dpow(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
else if (errno == ERANGE)
|
/* Some platoforms, e.g. HPPA, return ERANGE, but HUGE_VAL, not Inf */
|
||||||
{
|
else if (errno == ERANGE && !isinf(result))
|
||||||
result = (arg1 >= 0) ? get_float8_infinity() : -get_float8_infinity();
|
result = get_float8_infinity();
|
||||||
}
|
|
||||||
|
|
||||||
CHECKFLOATVAL(result, isinf(arg1) || isinf(arg2), arg1 == 0);
|
CHECKFLOATVAL(result, isinf(arg1) || isinf(arg2), arg1 == 0);
|
||||||
PG_RETURN_FLOAT8(result);
|
PG_RETURN_FLOAT8(result);
|
||||||
|
Loading…
Reference in New Issue
Block a user