From a57d312a7706321d850faa048a562a0c0c01b835 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 22 Jul 2020 19:19:44 -0400 Subject: Support infinity and -infinity in the numeric data type. Add infinities that behave the same as they do in the floating-point data types. Aside from any intrinsic usefulness these may have, this closes an important gap in our ability to convert floating values to numeric and/or replace float-based APIs with numeric. The new values are represented by bit patterns that were formerly not used (although old code probably would take them for NaNs). So there shouldn't be any pg_upgrade hazard. Patch by me, reviewed by Dean Rasheed and Andrew Gierth Discussion: https://postgr.es/m/606717.1591924582@sss.pgh.pa.us --- src/include/utils/numeric.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/utils/numeric.h') diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h index 0604cb65ed4..0b7d4ba3c4b 100644 --- a/src/include/utils/numeric.h +++ b/src/include/utils/numeric.h @@ -57,6 +57,7 @@ typedef struct NumericData *Numeric; * Utility functions in numeric.c */ extern bool numeric_is_nan(Numeric num); +extern bool numeric_is_inf(Numeric num); int32 numeric_maximum_size(int32 typmod); extern char *numeric_out_sci(Numeric num, int scale); extern char *numeric_normalize(Numeric num); -- cgit v1.2.3