mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user