Class Decimal

java.lang.Object
java.lang.Number
io.fluxzero.common.Decimal
All Implemented Interfaces:
Serializable, Comparable<Decimal>

public final class Decimal extends Number implements Comparable<Decimal>
Immutable arbitrary-precision decimal with numerical equality, independent of trailing zeros.

Arithmetic, scale, conversions, rounding and exceptions follow BigDecimal. Decimal-valued results remain Decimal, including array elements. Both Decimal and BigDecimal operands are accepted. Scale is preserved, but does not participate in equality or hashing. Equality with other Number types is deliberately false.

JSON uses an exact decimal string; readers also accept numeric tokens. Document indexing uses numeric entries. Use string constructors or valueOf(long) for exact input; double constructors retain BigDecimal's exact binary-floating-point conversion semantics. valueOf(double) follows BigDecimal.valueOf(double). Standard numeric constraints are supported by the Fluxzero validator; third-party providers may require adapters.

See Also: