A decimal floating point number. This class provides support
for fixed and arbitrary precision numbers. Values are immutable
and represented as unscaled * 10^(-scale)
. Methods without
an explicit Rounding
parameter use unlimitedPrecision
(unless documented otherwise) except for plus()
, minus()
,
times()
, divided()
and power()
whose implicit rounding
is subject to the rounding specified in implicitlyRounded()
.
implicitlyRounded()
no type hierarchy
no subtypes hierarchy
Attributes | |
float | Source Codeshared formal Float float The number, represented as a |
hash | Source Codeshared formal Integer hash The hash value of this Refines Object.hash |
implementation | Source Codeshared formal Object? implementation The platform-specific implementation object, if any. This is provided for interoperation with the runtime platform. |
integer | Source Codeshared formal Integer integer The number, represented as an |
precision | Source Codeshared formal Integer precision The precision of this decimal. This is the number of digits in the unscaled value. See also scale |
scale | Source Codeshared formal Integer scale The scale of this decimal. This is the number of digits to the right of the decimal point (for a positive scale) or the power of ten by which the unscaled value is multiplied (for a negative scale). See also unscaled |
unscaled | Source Codeshared formal Whole unscaled The unscaled value of this See also scale |
whole | Source Codeshared formal Whole whole The number, represented as a See also Whole |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Invertible<Other> |
Attributes inherited from: Number<Other> |
Methods | |
divided | Source Codeshared formal Decimal divided(Decimal other) The quotient obtained by dividing this See also dividedRounded() Refines Numeric.divided |
dividedAndRemainder | Source Codeshared formal DividedWithRemainder dividedAndRemainder(Decimal other, Rounding? rounding = null) A pair containing the same results as calling
Parameters:
Throws
See also dividedTruncated() , remainderRounded() |
dividedRounded | Source Codeshared formal Decimal dividedRounded(Decimal other, Rounding? rounding = null) The quotient obtained by dividing this Parameters:
See also divided() |
dividedTruncated | Source Codeshared formal Decimal dividedTruncated(Decimal other, Rounding? rounding = null) The integer part of the quotient obtained by dividing this
Parameters:
Throws See also dividedTruncated() |
equals | Source Codeshared formal Boolean equals(Object that) Determine whether two instances have equal value. See also strictlyEquals() Refines Object.equals |
minus | Source Codeshared formal Decimal minus(Decimal other) The difference between this See also minusRounded() Refines Invertible.minus |
minusRounded | Source Codeshared formal Decimal minusRounded(Decimal other, Rounding? rounding = null) The difference between this Parameters:
See also minus() |
plus | Source Codeshared formal Decimal plus(Decimal other) The sum of this See also plusRounded() Refines Summable.plus |
plusRounded | Source Codeshared formal Decimal plusRounded(Decimal other, Rounding? rounding = null) The sum of this Parameters:
See also plus() |
power | Source Codeshared formal Decimal power(Integer other) The result of raising this number to the given power.
Unless invoked within
Throws See also powerRounded() Refines Exponentiable.power |
powerRounded | Source Codeshared formal Decimal powerRounded(Integer other, Rounding? rounding = null) The result of raising this number to the given power with the given rounding. Fractional powers are not supported. Parameters:
See also power() |
remainderRounded | Source Codeshared formal Decimal remainderRounded(Decimal other, Rounding? rounding = null) The Decimal remainder after the division of this `this - this.dividedTruncated(other, rounding) * other This is not equivalent to the Parameters:
|
round | Source Codeshared formal Decimal round(Rounding rounding) This value rounded according to the given context. |
strictlyEquals | Source Codeshared formal Boolean strictlyEquals(Decimal that) Determine whether two instances have equal value and
scale. See also equals() |
times | Source Codeshared formal Decimal times(Decimal other) The product of this See also timesRounded() Refines Numeric.times |
timesRounded | Source Codeshared formal Decimal timesRounded(Decimal other, Rounding? rounding = null) The product of this Parameters:
See also times() |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Comparable<Other> |
Methods inherited from: Exponentiable<This,Other> |
Methods inherited from: Invertible<Other> |
Methods inherited from: Number<Other> |
Methods inherited from: Numeric<Other> |
Methods inherited from: Summable<Other> |