Numbers

Start of changeThe numeric data types are binary integer, decimal, decimal floating-point, and floating-point.End of change

Start of changeThe numeric data types are categorized as follows:End of change

Start of change
  • Exact numeric data types: binary integer and decimal
  • Decimal floating-point
  • Approximate numeric data types: floating-point
End of change

Binary integer includes small integer, large integer, and big integer. Binary numbers are exact representations of integers. Start of changeDecimal numbers are exact representations of real numbers, with a fixed precision and scale.End of change Binary and decimal numbers are considered exact numeric types.

Start of changeDecimal floating-point includes DECFLOAT(16) and DECFLOAT(34), which are capable of representing either 16 or 34 significant digits. The decimal floating-point data type supports both exact representations of real numbers and approximations of real numbers, and is not considered to be either an exact numeric type or an approximate numeric type.End of change

Floating-point includes single precision and double precision. Floating-point numbers are approximations of real numbers, and are considered to be approximate numeric types.

All numbers have a sign, a precision, and a scale. If a column value is zero, the sign is positive. Decimal floating point has distinct values for a number and the same number with various exponents (for example: 0.0, 0.00, 0.0E5, 1.0, 1.00, 1.0000). The precision is the total number of binary or decimal digits excluding the sign. The scale is the total number of binary or decimal digits to the right of the decimal point. If there is no decimal point, the scale is zero.