Rounding Modes
This pages describes the different rounding modes which can be selected for numeric field elements.
Round up
This modes rounds away from zero. It increases the absolute value of the number to round, if there is any fractional remainder.
Round down
This modes rounds towards zero. It decreases the absolute value of the number to round, if there is any fractional remainder.
Round ceiling
This modes rounds towards positive infinity. It increases the value of the number to round, if there is any fractional remainder. That way the rounded value will always be greater or equal to the value to round.
Round floor
This modes rounds towards negative infinity. It decreases the value of the number to round, if there is any fractional remainder. That way the rounded value will always be lesser or equal to the value to round.
Round half up
This modes rounds towards the nearest neighbor. If both neighbors are equidistant, this mode will have the same effect as round up.
Round half down
This modes rounds towards the nearest neighbor. If both neighbors are equidistant, this mode will have the same effect as round down.
Round half even
This modes rounds towards the nearest neighbor. If both neighbors are equidistant, this mode will round towards the even neighbor. Round half even has the minimum cumulative error and is therefore the default rounding mode.
Comparison of rounding modes
Input | Up | Down | Ceil | Floor | Half up | Half down | Half even |
-2.50 | -3 | -2 | -2 | -3 | -3 | -2 | -2 |
-1.50 | -2 | -1 | -1 | -2 | -2 | -1 | -2 |
-1.00 | -1 | -1 | -1 | -1 | -1 | -1 | -1 |
-0.60 | -1 | 0 | 0 | -1 | -1 | -1 | -1 |
0.60 | 1 | 0 | 1 | 0 | 1 | 1 | 1 |
1.00 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
1.50 | 2 | 1 | 2 | 1 | 2 | 1 | 2 |
2.50 | 3 | 2 | 3 | 2 | 3 | 2 | 2 |