Rounding functions

Rounding functions perform operations such as rounding and truncation of floating-point values.

Table 1. Rounding mode macros and values
Macro Integer value
DFP_ROUND_TO_NEAREST_WITH_TIES_TO_EVEN 0
DFP_ROUND_TOWARD_ZERO 1
DFP_ROUND_TOWARD_POSITIVE_INFINITY 2
DFP_ROUND_TOWARD_NEGATIVE_INFINITY 3
DFP_ROUND_TO_NEAREST_WITH_TIES_AWAY_FROM_ZERO 4
DFP_ROUND_TO_NEAREST_WITH_TIES_TOWARD_ZERO 5
DFP_ROUND_AWAY_FROM_ZERO 6
DFP_ROUND_TO_PREPARE_FOR_SHORTER_PRECISION 7
DFP_ROUND_USING_CURRENT_MODE1 8
Note:
  1. This value is valid only for functions that override the current rounding mode; it is not valid for __dfp_set_rounding_mode and can not be returned by __dfp_get_rounding_mode.