UNNECESSARY

Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary. If this rounding mode is specified on an operation that yields an inexact result, an ArithmeticException is thrown.

Example:

* * * * * * * * * * *
Rounding mode UNNECESSARY Examples
Input Number Input rounded to one digit

with `UNNECESSARY` rounding
5.5 throw `ArithmeticException`
2.5 throw `ArithmeticException`
1.6 throw `ArithmeticException`
1.1 throw `ArithmeticException`
1.0 1
-1.0 -1
-1.1 throw `ArithmeticException`
-1.6 throw `ArithmeticException`
-2.5 throw `ArithmeticException`
-5.5 throw `ArithmeticException`
*

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val value: Int