ROUNDING bind option
The ROUNDING option specifies the rounding mode at bind time. Use rounding mode to manipulate DECFLOAT data.
Command option | Option values | Used with |
---|---|---|
ROUNDING |
|
Note:
- The ROUNDING bind option is not valid for REBIND of packages for advanced triggers.
- ROUNDING(HALFUP)
-
Round to nearest; if equidistant, round up. If the discarded digits represent greater than or equal to half (0.5) of the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). Otherwise, the discarded digits are ignored.
HALFUP is the default option.
- ROUNDING(CEILING)
- Round toward +infinity. If all of the discarded digits are zero or if the sign is negative the result is unchanged other than the removal of discarded digits. Otherwise, the result coefficient should be incremented by 1 (round up).
- ROUNDING(DOWN)
- Round toward 0 (TRUNCATION). The discarded digits are ignored.
- ROUNDING(FLOOR)
- Round toward -infinity. If all of the discarded digits are zero or if the sign is positive the result is unchanged other than the removal of discarded digits. Otherwise, the sign is negative and the result coefficient should be incremented by 1.
- ROUNDING(HALFDOWN)
- Round to the nearest; if equidistant, round down. If the discarded digits represent greater than half (0.5) of the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). Otherwise, (the discarded digits are 0.5) or less) the discarded digits are ignored.
- ROUNDING(HALFEVEN)
- Round to the nearest; if equidistant, round so that the final digit is even. If the discarded digits represent greater than half (0.5) the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). If they represent less than half, then the result coefficient is not adjusted (that is, the discarded digits are ignored). Otherwise, (they represent exactly half) the result coefficient is unaltered if its rightmost digit is even, or incremented by 1 (rounded up) if its rightmost digit is odd (to make an even digit).
- ROUNDING(UP)
- Round away from 0. If all the discarded digits are zero the result is unchanged other than they removal of discarded digits. Otherwise, the result coefficient should be incremented by 1 (rounded up).
The default value of the ROUNDING option is the DEF DECFLOAT ROUNDING MODE value from the application defaults load module.
Default values for ROUNDING
Process | Default value |
---|---|
BIND SERVICE | HALFEVEN |
BIND PLAN | HALFEVEN |
BIND PACKAGE | HALFEVEN |
REBIND PLAN | Existing value |
REBIND PACKAGE | Existing value |
Catalog records for ROUNDING
See the ROUNDING column in SYSPACKAGE catalog table and SYSPLAN catalog table, and column ROUNDING_MODE of table SYSENVIRONMENT.