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 returns n. If NOT, returns this.
ifNaN(double n) double
If this number isNaN returns n. If NOT, returns this.
ifNotFinite(double n) double
If this number is NOT finite (![isFinite]) returns n. If NOT, returns this.
signWithZeroTolerance([double zeroTolerance = 0.0000000000001]) int
Returns the sign of this number, regarding the zeroTolerance.
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.