Package org.hipparchus.dfp
Enum DfpField.RoundingMode
- All Implemented Interfaces:
Serializable
,Comparable<DfpField.RoundingMode>
,java.lang.constant.Constable
- Enclosing class:
- DfpField
Enumerate for rounding modes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRounds towards positive infinity.Rounds toward zero (truncation).Rounds towards negative infinity.Rounds towards nearest unless both are equidistant in which case it rounds toward zero.Rounds towards nearest unless both are equidistant in which case it rounds toward the even neighbor.Rounds towards nearest unless both are equidistant in which case it rounds toward the odd neighbor.Rounds towards nearest unless both are equidistant in which case it rounds away from zero.Rounds away from zero if discarded digit is non-zero. -
Method Summary
Modifier and TypeMethodDescriptionstatic DfpField.RoundingMode
Returns the enum constant of this type with the specified name.static DfpField.RoundingMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ROUND_DOWN
Rounds toward zero (truncation). -
ROUND_UP
Rounds away from zero if discarded digit is non-zero. -
ROUND_HALF_UP
Rounds towards nearest unless both are equidistant in which case it rounds away from zero. -
ROUND_HALF_DOWN
Rounds towards nearest unless both are equidistant in which case it rounds toward zero. -
ROUND_HALF_EVEN
Rounds towards nearest unless both are equidistant in which case it rounds toward the even neighbor. This is the default as specified by IEEE 854-1987 -
ROUND_HALF_ODD
Rounds towards nearest unless both are equidistant in which case it rounds toward the odd neighbor. -
ROUND_CEIL
Rounds towards positive infinity. -
ROUND_FLOOR
Rounds towards negative infinity.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-