Return a new Decimal whose value is the absolute value of this Decimal.
Return
1 if the value of this Decimal is greater than the value of y
,
-1 if the value of this Decimal is less than the value of y
,
0 if they have the same value
Return
1 if the value of this Decimal is greater than the value of y
,
-1 if the value of this Decimal is less than the value of y
,
0 if they have the same value
Return the number of decimal places of the value of this Decimal.
Return the number of decimal places of the value of this Decimal.
Return true if the value of this Decimal is equal to the value of y
, otherwise return false.
Return true if the value of this Decimal is equal to the value of y
, otherwise return false.
Return a new Decimal whose value is the natural exponential of the value of this Decimal,
i.e. the base e raised to the power the value of this Decimal, truncated to precision
significant digits.
Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).
Return true if the value of this Decimal is greater than the value of y
, otherwise return
false.
Return true if the value of this Decimal is greater than or equal to the value of y
,
otherwise return false.
Return true if the value of this Decimal is greater than the value of y
, otherwise return
false.
Return true if the value of this Decimal is greater than or equal to the value of y
,
otherwise return false.
Return true if the value of this Decimal is an integer, otherwise return false.
Return true if the value of this Decimal is an integer, otherwise return false.
Return true if the value of this Decimal is negative, otherwise return false.
Return true if the value of this Decimal is negative, otherwise return false.
Return true if the value of this Decimal is positive, otherwise return false.
Return true if the value of this Decimal is positive, otherwise return false.
Return true if the value of this Decimal is 0, otherwise return false.
Return true if the value of this Decimal is less than y
, otherwise return false.
Return true if the value of this Decimal is less than or equal to y
, otherwise return false.
Return a new Decimal whose value is the natural logarithm of the value of this Decimal,
truncated to precision
significant digits.
Return true if the value of this Decimal is less than y
, otherwise return false.
Return true if the value of this Decimal is less than or equal to y
, otherwise return false.
Return a new Decimal whose value is the natural exponential of the value of this Decimal,
i.e. the base e raised to the power the value of this Decimal, truncated to precision
significant digits.
Return a new Decimal whose value is the natural logarithm of the value of this Decimal,
truncated to precision
significant digits.
Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by -1.
Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by -1.
Return a new Decimal whose value is the value of this Decimal raised to the power y
,
truncated to precision
significant digits.
For non-integer or very large exponents pow(x, y) is calculated using
x^y = exp(y*ln(x))
The maximum error is 1 ulp (unit in last place).
The power to which to raise this Decimal.
Return the number of significant digits of the value of this Decimal.
Whether to count integer-part trailing zeros: true, false, 1 or 0.
Return the number of significant digits of the value of this Decimal.
Whether to count integer-part trailing zeros: true, false, 1 or 0.
Return a new Decimal whose value is the square root of this Decimal, truncated to precision
significant digits.
Return a new Decimal whose value is the square root of this Decimal, truncated to precision
significant digits.
Return a new Decimal whose value is the value of this Decimal rounded to a maximum of dp
decimal places using rounding mode rm
or rounding
if rm
is omitted.
If dp
is omitted, return a new Decimal whose value is the value of this Decimal.
Optional
dp: numberDecimal places. Integer, 0 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
Return a new Decimal whose value is the value of this Decimal rounded to a maximum of dp
decimal places using rounding mode rm
or rounding
if rm
is omitted.
If dp
is omitted, return a new Decimal whose value is the value of this Decimal.
Optional
dp: numberDecimal places. Integer, 0 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
Return a string representing the value of this Decimal in exponential notation rounded to
dp
fixed decimal places using rounding mode rounding
.
Optional
dp: numberDecimal places. Integer, 0 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
Return a string representing the value of this Decimal in normal (fixed-point) notation to
dp
fixed decimal places and rounded using rounding mode rm
or rounding
if rm
is
omitted.
As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.
Optional
dp: numberDecimal places. Integer, 0 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
(-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'. (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'. (-0).toFixed(3) is '0.000'. (-0.5).toFixed(0) is '-0'.
Return a new Decimal whose value is the value of this Decimal rounded to a whole number using
rounding mode rounding
.
Return a new Decimal whose value is the value of this Decimal rounded to a whole number using
rounding mode rounding
.
Return a string representing the value of this Decimal.
Return exponential notation if this Decimal has a positive exponent equal to or greater than
toExpPos
, or a negative exponent equal to or less than toExpNeg
.
Return the value of this Decimal converted to a number primitive.
Return a new Decimal whose value is the value of this Decimal raised to the power y
,
truncated to precision
significant digits.
For non-integer or very large exponents pow(x, y) is calculated using
x^y = exp(y*ln(x))
The maximum error is 1 ulp (unit in last place).
The power to which to raise this Decimal.
Return a string representing the value of this Decimal rounded to sd
significant digits
using rounding mode rounding
.
Return exponential notation if sd
is less than the number of digits necessary to represent
the integer part of the value in normal notation.
Optional
sd: numberSignificant digits. Integer, 1 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
Return a new Decimal whose value is the value of this Decimal rounded to a maximum of sd
significant digits using rounding mode rm
, or to precision
and rounding
respectively if
omitted.
Optional
sd: numberSignificant digits. Integer, 1 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
Return a new Decimal whose value is the value of this Decimal rounded to a maximum of sd
significant digits using rounding mode rm
, or to precision
and rounding
respectively if
omitted.
Optional
sd: numberSignificant digits. Integer, 1 to MAX_DIGITS inclusive.
Optional
rm: numberRounding mode. Integer, 0 to 8 inclusive.
Return a string representing the value of this Decimal.
Return exponential notation if this Decimal has a positive exponent equal to or greater than
toExpPos
, or a negative exponent equal to or less than toExpNeg
.
Return a string representing the value of this Decimal.
Return exponential notation if this Decimal has a positive exponent equal to or greater than
toExpPos
, or a negative exponent equal to or less than toExpNeg
.
Return a string representing the value of this Decimal.
Return exponential notation if this Decimal has a positive exponent equal to or greater than
toExpPos
, or a negative exponent equal to or less than toExpNeg
.
Return a new Decimal whose value is the absolute value of this Decimal.