SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
N-12
Considerations—Numeric Data Types
Considerations—Numeric Data Types
All the preceding data types are exact data types except for the floating point
types, which are approximate data types. Exact data types have greater precision.
Approximate data types are subject to rounding error and should not be used for
equality comparisons or other operations that require exact results.
Floating point (approximate) data types should be used for very large or very small
numbers that cannot be stored in other data types. If you can represent column
values with an exact data type, use the exact data type instead of a floating point
data type.
For more information about numeric data types, see Data Types on page D-1.
Table N-2. Numeric Data Types in SQL—Floating Point Types
SQL Designation Description Size or Range (1)
FLOAT [(pre)] Approximate floating point number;
pre-designates from 1 through 54
bits of precision
+/-8.62 times 10**-78
through +/-1.16 times
10**77;
stored:
pre 1 to 22 in 4 bytes,
pre 23 to 54 in 8 bytes
REAL Approximate floating point number
(22 bits)
Approximately 7 decimal
digits of precision;
same range as FLOAT;
stored in 4 bytes
DOUBLE PRECISION Approximate floating point number
(54 bits)
Approximately 16
decimal digits of
precision;
same range as FLOAT;
stored in 8 bytes
Table N-3. Numeric Data Types in SQL—Decimal Types
SQL Designation Description Size or Range (1)
DECIMAL (1,s) to
DECIMAL (18,s) and
PIC S9V9 DISPLAY to
PIC S9(18) DISPLAY
Decimal number with optional scale;
stored in ASCII; must be signed if 10
or more digits, otherwise can be
signed or unsigned.
1 to 18 digits; byte
length equals the
number of digits