public enum DivisionMode extends Enum<DivisionMode>
0 <= r < b,
fulfilling the equations:a/b = q + r/ba = b*q + rr = a - b*q| Enum Constant and Description |
|---|
EUCLIDEAN
Euclidean division chooses a quotient which will ensure that the remainder is always positive.
|
FLOORED
In floored division, the quotient is floored (rounded toward negative infinity).
|
TRUNCATED
In truncated division, the quotient is truncated (rounded toward zero).
|
| Modifier and Type | Method and Description |
|---|---|
static DivisionMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DivisionMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DivisionMode TRUNCATED
q = trunc(a/b) (round toward zero)r = a - b*qpublic static final DivisionMode FLOORED
q = floor(a/b) (round toward negative infinity)r = a - b*qpublic static final DivisionMode EUCLIDEAN
q = sign(b) * floor(a/abs(b))b > 0: q = floor(a/b)b < 0: q = ciel(a/b)r = a - b*qpublic static DivisionMode[] values()
for (DivisionMode c : DivisionMode.values()) System.out.println(c);
public static DivisionMode 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 null