Numeric data types
272
NUMERIC data type [Numeric]
Same as DECIMAL.
NUMERIC [ (
precision
[ ,
scale
] ) ]
The NUMERIC data type is an exact numeric data type; its accuracy is
preserved to the least significant digit after arithmetic operations.
The storage required for a decimal number can be estimated as:
2 + int( (before+1) / 2 ) + int( (after+1)/2 )
where int takes the integer portion of its argument, and before and after are
the number of significant digits before and after the decimal point. The
storage is based on the value being stored, not on the maximum precision
and scale allowed in the column.
precision An integer expression that specifies the number of digits in the
expression. The default value is 30.
scale An integer expression that specifies the number of digits after the
decimal point. The default value is 6.
The defaults can be changed by setting database options. For information,
see "PRECISION option" on page 205 and "SCALE option" on page 210.
♦
SQL/92 Compatible with SQL/92, if the SCALE option is set to zero.
♦
Sybase Compatible with Adaptive Server Enterprise.
"FLOAT data type" on page 270
"REAL data type" on page 272
"DOUBLE data type" on page 270
REAL data type [Numeric]
A single-precision floating-point number stored in 4 bytes.
REAL
The REAL data type is an approximate numeric data type; it is subject to
roundoff errors after arithmetic operations.
The range of values is 1.175495e-38 to 3.402823e+38. Values held as REAL
are accurate to 10 significant digits, but may be subject to round-off error
beyond the sixth digit.
The approximate nature of REAL values means that queries using equalities
should generally be avoided when comparing REAL values
Function
Syntax
Usage
Parameters
Standards and
compatibility
See also
Function
Syntax
Usage