diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 34af82629e..269998a3dd 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -438,10 +438,14 @@ Arbitrary Precision Numbers - + numeric (data type) + + arbitrary precision numbers + + decimal numeric @@ -515,6 +519,16 @@ NUMERIC plus eight bytes overhead. + + NaN + not a number + + + + not a number + numeric (data type) + + In addition to ordinary numeric values, the numeric type allows the special value NaN, meaning @@ -525,6 +539,18 @@ NUMERIC the string NaN is recognized in a case-insensitive manner. + + + In most implementations of the not-a-number concept, + NaN is not considered equal to any other numeric + value (including NaN). In order to allow + numeric values to be sorted and used in tree-based + indexes, PostgreSQL treats NaN + values as equal, and greater than all non-NaN + values. + + + The types decimal and numeric are equivalent. Both types are part of the SQL @@ -613,6 +639,11 @@ NUMERIC from zero will cause an underflow error. + + not a number + double precision + + In addition to ordinary numeric values, the floating-point types have several special values: @@ -631,6 +662,17 @@ NUMERIC these strings are recognized in a case-insensitive manner. + + + IEEE754 specifies that NaN should not compare equal + to any other floating-point value (including NaN). + In order to allow floating-point values to be sorted and used + in tree-based indexes, PostgreSQL treats + NaN values as equal, and greater than all + non-NaN values. + + + PostgreSQL also supports the SQL-standard notations float and