DoubleExtension extension
extension for double
.
- on
Properties
- isWholeNumber → bool
-
Returns
true
if this double is a whole number.no setter - naturalExponent → double
-
Returns the natural exponent, e, to the power of
this
number.no setter - square → double
-
Returns the square of
this
number.no setter - squareRoot → double
-
Returns the square root of
this
number.no setter
Methods
-
compactType(
) → num -
Returns an int for this double if isWholeNumber otherwise returns
this
. -
ifInfinite(
double n) → double -
If
this
number isInfinite returnsn
. If NOT, returnsthis
. -
ifNaN(
double n) → double -
If
this
number isNaN returnsn
. If NOT, returnsthis
. -
ifNotFinite(
double n) → double -
If
this
number is NOT finite (![isFinite]) returnsn
. If NOT, returnsthis
. -
signWithZeroTolerance(
[double zeroTolerance = 0.0000000000001]) → int -
Returns the sign of
this
number, regarding thezeroTolerance
. -
toBigInt(
) → BigInt -
Converts this
double
to BigInt. -
toPercentage(
{int fractionDigits = 2, String suffix = '%'}) → String -
Converts to a percentage string (multiplying by
100
). -
truncateDecimals(
int fractionDigits) → double - Truncate the decimal part of this double number. This function is very useful for compere two double numbers.