These data types are used to store floating point numbers. Since these types are intended to hold approximate numeric values only, these should not be used in cases where any rounding error is unacceptable. However, if you need to handle very large numbers, or numbers with an indeterminate number of digits after the decimal place, these may be your best option.
Data type | Range | Size |
---|---|---|
float | -1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+308 | depends on n in table below |
real | -3.40E + 38 to -1.18E - 38, 0 and 1.18E - 38 to 3.40E + 38 | 4 Bytes |
n value table for float numbers. If no value is specified in the declaration of the float, the default value of 53 will be used. Note that float(24) is the equivalent of a real value.
n value | Precision | Size |
---|---|---|
1-24 | 7 digits | 4 bytes |
25-53 | 15 digits | 8 bytes |