--- old/src/java.base/share/classes/java/math/RoundingMode.java 2017-05-05 15:25:42.719414006 -0700 +++ new/src/java.base/share/classes/java/math/RoundingMode.java 2017-05-05 15:25:42.591408416 -0700 @@ -51,8 +51,9 @@ * proper {@code MathContext}. A summary table showing the results * of these rounding operations for all rounding modes appears below. * - *
Result of rounding input to one digit with the given * rounding mode | *||||||||
---|---|---|---|---|---|---|---|---|
{@code HALF_DOWN} | *{@code HALF_EVEN} | *{@code UNNECESSARY} | + *||||||
5.5 | 6 | 5 | 6 | 5 | 6 | 5 | 6 | throw {@code ArithmeticException} | *
2.5 | 3 | 2 | 3 | 2 | 3 | 2 | 2 | throw {@code ArithmeticException} | @@ -75,7 +78,8 @@ *
-1.6 | -2 | -1 | -1 | -2 | -2 | -2 | -2 | throw {@code ArithmeticException} | *
-2.5 | -3 | -2 | -2 | -3 | -3 | -2 | -2 | throw {@code ArithmeticException} | *
-5.5 | -6 | -5 | -5 | -6 | -6 | -5 | -6 | throw {@code ArithmeticException} | - *
This {@code enum} is intended to replace the integer-based @@ -100,10 +104,13 @@ * value. * *
Example: - *
Input Number | *Input rounded to one digit with {@code UP} rounding + * |
---|---|
5.5 | 6 | *
2.5 | 3 | *
1.6 | 2 | @@ -114,6 +121,7 @@ *
-1.6 | -2 | *
-2.5 | -3 | *
-5.5 | -6 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code DOWN} rounding + * |
---|---|
5.5 | 5 | *
2.5 | 2 | *
1.6 | 1 | @@ -138,6 +149,7 @@ *
-1.6 | -1 | *
-2.5 | -2 | *
-5.5 | -5 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code CEILING} rounding + * |
---|---|
5.5 | 6 | *
2.5 | 3 | *
1.6 | 2 | @@ -163,6 +178,7 @@ *
-1.6 | -1 | *
-2.5 | -2 | *
-5.5 | -5 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code FLOOR} rounding + * |
---|---|
5.5 | 5 | *
2.5 | 2 | *
1.6 | 1 | @@ -188,6 +207,7 @@ *
-1.6 | -2 | *
-2.5 | -3 | *
-5.5 | -6 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code HALF_UP} rounding + * |
---|---|
5.5 | 6 | *
2.5 | 3 | *
1.6 | 2 | @@ -215,6 +238,7 @@ *
-1.6 | -2 | *
-2.5 | -3 | *
-5.5 | -6 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code HALF_DOWN} rounding + * |
---|---|
5.5 | 5 | *
2.5 | 2 | *
1.6 | 2 | @@ -241,6 +268,7 @@ *
-1.6 | -2 | *
-2.5 | -2 | *
-5.5 | -5 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code HALF_EVEN} rounding + * |
---|---|
5.5 | 6 | *
2.5 | 2 | *
1.6 | 2 | @@ -274,6 +305,7 @@ *
-1.6 | -2 | *
-2.5 | -2 | *
-5.5 | -6 | + *
Example: - *
Input Number | *Input rounded to one digit with {@code UNNECESSARY} rounding + * |
---|---|
5.5 | throw {@code ArithmeticException} | *
2.5 | throw {@code ArithmeticException} | *
1.6 | throw {@code ArithmeticException} | @@ -298,6 +333,7 @@ *
-1.6 | throw {@code ArithmeticException} | *
-2.5 | throw {@code ArithmeticException} | *
-5.5 | throw {@code ArithmeticException} | + *