2. Language Elements : Data Types : Numeric Data Types : Floating Point Data Types
 
Share this page                  
Floating Point Data Types
A floating point value is represented either as whole plus fractional digits (like decimal values) or as a mantissa plus an exponent. The following is an example of the mantissa and exponent parts of floating point values:
There are two floating point data types:
float4 (4-byte)
float (8-byte)
Note:  A synonym for float4 is real. Synonyms for float are float8 and double precision.
Floating point numbers are stored in four or eight bytes. Internally, eight byte numbers are rounded to 15 decimal digits. The precision of four byte numbers is processor dependent.
You can specify the binary precision (number of significant bits) for a floating point value using the following optional syntax:
float(n)
where n is a value from 0 to 53. Storage is allocated according to the precision that is specified, as follows:
Range of Binary Precision
Storage Allocated
0 to 23
4-byte float
24 to 53
8-byte float
Float Point Limitations
Users must consider the effects of data type conversions when numeric values are combined or compared. This is especially true when dealing with floating point values.
Exact matches on floating point numbers are discouraged, because float and float4 data types are approximate numeric values. In contrast, integer and decimal data types are exact numeric values.