FLOOR
FLOOR returns the largest integer value less than or equal to x.
- x
- Real expression.
The mode, base, scale, and precision of the result match the argument. Except when
x is fixed-point with precision (p,q), the
precision of the result is given by:
(min(n,max(p-q+1,1)),0)
where n is the maximum number of digits allowed and is N for FIXED DECIMAL or M for FIXED BINARY.
If the expression x has the form
(y/z) where y is an
unscaled FIXED BIN expression and z is an unscaled FIXED expression, then
FLOOR(x) will be evaluated by computing the integral quotient and then
rounding it down by one if the following conditions are met:
- The quotient is not positive.
- The remainder of (y/z) is not zero.
If the expression x has the form
(y/z) where y is an
unscaled FIXED BIN expression and z is an unscaled FIXED expression, then
TRUNC(x) will be evaluated by computing the integral quotient and then
rounding it according to the following conditions:
- Round it down if both conditions are met:
- The quotient is nonnegative.
- The remainder of (y/z) is not zero.
- Round it up if both conditions are met:
- The quotient is not positive.
- The remainder of (y/z) is not zero.
If the expression x has the attributes FIXED BIN(p,q) but does not have the form above, then q must be positive.