public enum ERounding extends Enum<ERounding>
| Enum Constant and Description |
|---|
Ceiling
If there is a fractional part, the number is rounded to the highest
representable number that's closest to it.
|
Down
The fractional part is discarded (the number is truncated).
|
Floor
If there is a fractional part, the number is rounded to the lowest
representable number that's closest to it.
|
HalfDown
Rounded to the nearest number; if the fractional part is exactly half, it is
discarded.
|
HalfEven
Rounded to the nearest number; if the fractional part is exactly half, the
number is rounded to the closest representable number that is even.
|
HalfUp
Rounded to the nearest number; if the fractional part is exactly half, the
number is rounded to the closest representable number away from zero.
|
None
Indicates that rounding will not be used.
|
Odd
If there is a fractional part and the whole number part is even, the number
is rounded to the closest representable odd number away from zero.
|
OddOrZeroFiveUp
For binary floating point numbers, this is the same as Odd.
|
Up
If there is a fractional part, the number is rounded to the closest
representable number away from zero.
|
ZeroFiveUp
If there is a fractional part and if the last digit before rounding is 0 or
half the radix, the number is rounded to the closest representable
number away from zero; otherwise the fractional part is discarded.
|
| Modifier and Type | Method and Description |
|---|---|
static ERounding |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ERounding[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ERounding None
public static final ERounding Up
public static final ERounding Down
public static final ERounding HalfUp
public static final ERounding HalfDown
public static final ERounding HalfEven
public static final ERounding Ceiling
public static final ERounding Floor
public static final ERounding Odd
public static final ERounding ZeroFiveUp
public static final ERounding OddOrZeroFiveUp
public static ERounding[] values()
for (ERounding c : ERounding.values()) System.out.println(c);
public static ERounding valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCBOR for Java documentation, generated in 2016.