Configuring rounding operators
In the default configuration, you can use the following rounding operators in a rate routine:
- R – Round half up. Round towards the nearest number according to scale. If both numbers are equidistant, round away from 0.
- RD – Round down. Round down to the nearest number according to scale. Always round towards 0.
- RU – Round up. Round up to the nearest number according to scale. Always round away from 0.
- RE – Round half-even. Round towards the nearest number according to scale, unless both numbers are equidistant. If equidistant, round towards the even number.
Through configuration, you can make the following optional rounding operators available in rate routines:
- RC – Round ceiling. Round up to positive infinity.
- RF – Round floor. Round down to negative infinity.
- HD – Round half-down. Round towards nearest number according to scale, unless both numbers are equidistant. If equidistant, round towards 0.
- NR – Unnecessary. The requested operation is expected to produce an exact result. Throws an exception if rounding is necessary.
See also
