Summary: in this tutorial, you will learn about the floating-point data types including
Oracle 10g introduces two new floating point data types
BINARY_DOUBLE that allow you to store floating-point numbers in your table columns.
The floating-point numbers do not have the same precision as the
NUMBER values, but they have a better performance for numerical computations. Because of this, the floating-point numbers are suitable for the scientific calculations but not suitable for financial calculations.
- IEEE 32 bit floating-point values
- Range of +/3.4E+38
- Precision of 6-7 digits
- Require 4 bytes.
- IEEE 64 bit floating-point value
- Range of +/1.7E+308
- Precision of 15 digits
- Requires 8 bytes.
Oracle binary floating-point numbers support the special values Infinity and NaN (which stands for Not a Number) as follows:
|Value|| || |
|Maximum positive finite value||3.40282E+38F||1.79769313486231E+308|
|Minimum positive finite value||1.17549E-38F||2.22507485850720E-308|
To specify floating-point number literals, you add the suffix
f for single precision and
d double precision, as shown below:
Code language: SQL (Structured Query Language) (sql)
SELECT 10.2d, 32.7f FROM dual;
The following are the major differences between
FLOAT data type and floating-point data type:
- The floating-point data types take advantage of hardware acceleration, therefore, they have better performance for numerical computations.
- The floating-point data types can store smaller / larger numbers than
- The floating-point data types store only approximate values, while the
FLOATdata type stores exact values.
In this tutorial, you have learned about the Oracle floating-point data types including