RoundingMode

Rounding modes. To better understand how rounding is performed, consult the table below.

ValuetiesToEventiesToAwaytowardPositivetowardNegativetowardZero
+1.3+1+1+2+1+1
+1.5+2+2+2+1+1
+1.8+2+2+2+1+1
-1.3-1-1-1-2-1
-1.5-2-2-1-2-1
-1.8-2-2-1-2-1
+2.3+2+2+3+2+2
+2.5+2+3+3+2+2
+2.8+3+3+3+2+2
-2.3-2-2-2-3-2
-2.5-2-3-2-3-2
-2.8-3-3-2-3-2

Values

ValueMeaning
tiesToEven

rounded away from zero; halfs are rounded to the nearest even number

tiesToAway

rounded away from zero

towardPositive

truncated toward positive infinity

towardNegative

truncated toward negative infinity

towardZero

truncated toward zero

implicittiesToEven

Meta