NORMALIZE_DECFLOAT scalar function
The NORMALIZE_DECFLOAT function returns a DECFLOAT value that is the result of the argument, set to its simplest form. That is, a non-zero number that has any trailing zeros in the coefficient has those zeros removed by dividing the coefficient by the appropriate power of ten and adjusting the exponent accordingly. A zero has its exponent set to 0.
The schema is SYSIBM.
- decfloat-expression
- The argument must be an expression that returns a DECFLOAT value.
decfloat-expression can also be a character string or graphic string data type. The string input is implicitly cast to a numeric value of DECFLOAT(34).
If the argument is a special decimal floating point value then the general rules for arithmetic operations apply. For more information, see General arithmetic operation rules for DECFLOAT
The result of the function is a DECFLOAT(16) value if the data type of decfloat-expression is DECFLOAT(16). Otherwise, the result of the function is a DECFLOAT(34) value.
The result can be null; if the argument is null, the result is the null value.
NORMALIZE_DECFLOAT(DECFLOAT(2.1)) = 2.1
NORMALIZE_DECFLOAT(DECFLOAT(-2.0)) = -2
NORMALIZE_DECFLOAT(DECFLOAT(1.200)) = 1.2
NORMALIZE_DECFLOAT(DECFLOAT(-120)) = -1.2E+2
NORMALIZE_DECFLOAT(DECFLOAT(120.00)) = 1.2E+2
NORMALIZE_DECFLOAT(DECFLOAT(0.00)) = 0
NORMALIZE_DECFLOAT(-NAN) = -NAN
NORMALIZE_DECFLOAT(-INFINITY) = -INFINITY