Skip to content

Commit e80b0bd

Browse files
committed
Check for ERANGE in exp() as well.
Improve release docs for ecpg regression tests.
1 parent 19ce06b commit e80b0bd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/backend/utils/adt/float.c

Lines changed: 6 additions & 4 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.144 2007/01/06 04:14:55 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.145 2007/01/06 15:18:02 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1444,8 +1444,8 @@ dpow(PG_FUNCTION_ARGS)
14441444
* using errno. However, some platform/CPU combinations return
14451445
* errno == EDOM and result == Nan for negative arg1 and very large arg2
14461446
* (they must be using something different from our floor() test to
1447-
* decide it's invalid). Other platforms return errno == ERANGE and a
1448-
* large but finite result to signal overflow.
1447+
* decide it's invalid). Other platforms (HPPA) return errno == ERANGE
1448+
* and a large (HUGE_VAL) but finite result to signal overflow.
14491449
*/
14501450
errno = 0;
14511451
result = pow(arg1, arg2);
@@ -1459,7 +1459,6 @@ dpow(PG_FUNCTION_ARGS)
14591459
else
14601460
result = 1;
14611461
}
1462-
/* Some platoforms, e.g. HPPA, return ERANGE, but HUGE_VAL, not Inf */
14631462
else if (errno == ERANGE && !isinf(result))
14641463
result = get_float8_infinity();
14651464

@@ -1477,7 +1476,10 @@ dexp(PG_FUNCTION_ARGS)
14771476
float8 arg1 = PG_GETARG_FLOAT8(0);
14781477
float8 result;
14791478

1479+
errno = 0;
14801480
result = exp(arg1);
1481+
if (errno == ERANGE && !isinf(result))
1482+
result = get_float8_infinity();
14811483

14821484
CHECKFLOATVAL(result, isinf(arg1), false);
14831485
PG_RETURN_FLOAT8(result);

src/tools/RELEASE_CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ For Major Releases
3535
* Bump library versions, if appropriate (see below)
3636
o src/interfaces/*/Makefile
3737
o src/interfaces/*/*/Makefile
38-
o update ecpg regression expected files
38+
o update ecpg regression expected files for new library number
3939

4040
* Release notes
4141
o check that dashed items from the TODO list are complete

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy