double class Null safety
A double-precision floating point number.
Representation of Dart doubles containing double specific constants and operations and specializations of operations inherited from num. Dart doubles are 64-bit floating-point numbers as specified in the IEEE 754 standard.
The double type is contagious. Operations on doubles return double results.
It is a compile-time error for a class to attempt to extend or implement double.
Constructors
- double()
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- isFinite → bool
-
True if the number is finite; otherwise, false. [...]
read-only, inherited
- isInfinite → bool
-
True if the number is positive infinity or negative infinity; otherwise,
false.
read-only, inherited
- isNaN → bool
-
True if the number is the double Not-a-Number value; otherwise, false.
read-only, inherited
- isNegative → bool
-
True if the number is negative; otherwise, false. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- sign → double
-
Returns the sign of the double's numerical value. [...]
read-only, override
Methods
-
abs(
) → double -
Returns the absolute value of this double.
override
-
ceil(
) → int -
Returns the least integer no smaller than
this
. [...]override -
ceilToDouble(
) → double -
Returns the least integer double value no smaller than
this
. [...]override -
clamp(
num lowerLimit, num upperLimit) → num -
Returns this num clamped to be in the range
lowerLimit
-upperLimit
. [...]inherited -
compareTo(
num other) → int -
Compares this to
other
. [...]inherited -
floor(
) → int -
Returns the greatest integer no greater than
this
. [...]override -
floorToDouble(
) → double -
Returns the greatest integer double value no greater than
this
. [...]override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
remainder(
num other) → double -
Returns the remainder of the truncating division of
this
byother
. [...]override -
round(
) → int -
Returns the integer closest to
this
. [...]override -
roundToDouble(
) → double -
Returns the integer double value closest to
this
. [...]override -
toDouble(
) → double -
Return this num as a double. [...]
inherited
-
toInt(
) → int -
Truncates this num to an integer and returns the result as an int.
inherited
-
toString(
) → String -
Provide a representation of this double value. [...]
override
-
toStringAsExponential(
[int? fractionDigits]) → String -
Returns an exponential string-representation of
this
. [...]inherited -
toStringAsFixed(
int fractionDigits) → String -
Returns a decimal-point string-representation of
this
. [...]inherited -
toStringAsPrecision(
int precision) → String -
Converts
this
to a double and returns a string representation with exactlyprecision
significant digits. [...]inherited -
truncate(
) → int -
Returns the integer obtained by discarding any fractional
digits from
this
. [...]override -
truncateToDouble(
) → double -
Returns the integer double value obtained by discarding any fractional
digits from
this
. [...]override
Operators
-
operator %(
num other) → double -
Euclidean modulo operator. [...]
override
-
operator *(
num other) → double -
Multiplication operator.
override
-
operator +(
num other) → double -
Addition operator.
override
-
operator -(
num other) → double -
Subtraction operator.
override
-
operator /(
num other) → double -
Division operator.
override
-
operator <(
num other) → bool -
Relational less than operator.
inherited
-
operator <=(
num other) → bool -
Relational less than or equal operator.
inherited
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
-
operator >(
num other) → bool -
Relational greater than operator.
inherited
-
operator >=(
num other) → bool -
Relational greater than or equal operator.
inherited
-
operator unary-(
) → double -
Negate operator.
override
-
operator ~/(
num other) → int -
Truncating division operator. [...]
override
Static Methods
Constants
- infinity → const double
-
1.0 / 0.0
- maxFinite → const double
-
1.7976931348623157e+308
- minPositive → const double
-
5e-324
- nan → const double
-
0.0 / 0.0
- negativeInfinity → const double
-
-infinity