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.
See also:
- num the super class for double.
- Numbers in A tour of the Dart language.
- Inheritance
- Available extensions
Properties
-
address
โ Pointer<
Never> -
Available on double, provided by the DoubleAddress extension
The memory address of the underlying data.getter/setter pair - hashCode โ int
-
Returns a hash code for a numerical value.
no setterinherited
- isFinite โ bool
-
Whether this number is finite.
no setterinherited
- isInfinite โ bool
-
Whether this number is positive infinity or negative infinity.
no setterinherited
- isNaN โ bool
-
Whether this number is a Not-a-Number value.
no setterinherited
- isNegative โ bool
-
Whether this number is negative.
no setterinherited
- runtimeType โ Type
-
A representation of the runtime type of the object.
no setterinherited
- sign โ double
-
The sign of the double's numerical value.
no setteroverride
- toJS โ JSNumber
-
Available on double, provided by the DoubleToJSNumber extension
Converts this double to a JSNumber.no setter - toJS โ JSNumber
-
Available on num, provided by the NumToJSExtension extension
Converts this num to a JSNumber.no setter
Methods
-
abs(
) โ double -
The absolute value of this number.
override
-
ceil(
) โ int -
Returns the least integer that is not smaller than this number.
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 number.
override
-
floorToDouble(
) โ double -
Returns the greatest integer double value no greater than
this
.override -
noSuchMethod(
Invocation invocation) โ dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remainder(
num other) โ double -
The remainder of the truncating division of
this
byother
.override -
round(
) โ int -
Returns the integer closest to this number.
override
-
roundToDouble(
) โ double -
Returns the integer double value closest to
this
.override -
toDouble(
) โ double -
This number 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 -
An exponential string-representation of this number.
inherited
-
toStringAsFixed(
int fractionDigits) โ String -
A decimal-point string-representation of this number.
inherited
-
toStringAsPrecision(
int precision) โ String -
A string representation with
precision
significant digits.inherited -
truncate(
) โ int -
Returns the integer obtained by discarding any fractional
part of this number.
override
-
truncateToDouble(
) โ double -
Returns the integer double value obtained by discarding any fractional
digits from
this
.override
Operators
-
operator %(
num other) โ double -
Euclidean modulo of this number by
other
.override -
operator *(
num other) โ double -
Multiplies this number by
other
.override -
operator +(
num other) โ double -
Adds
other
to this number.override -
operator -(
num other) โ double -
Subtracts
other
from this number.override -
operator /(
num other) โ double -
Divides this number by
other
.override -
operator <(
num other) โ bool -
Whether this number is numerically smaller than
other
.inherited -
operator <=(
num other) โ bool -
Whether this number is numerically smaller than or equal to
other
.inherited -
operator ==(
Object other) โ bool -
Test whether this value is numerically equal to
other
.inherited -
operator >(
num other) โ bool -
Whether this number is numerically greater than
other
.inherited -
operator >=(
num other) โ bool -
Whether this number is numerically greater than or equal to
other
.inherited -
operator unary-(
) โ double -
Subtracts
other
from this number.override -
operator ~/(
num other) โ int -
Truncating division operator.
override
Static Methods
Constants
- infinity โ const double
- maxFinite โ const double
- minPositive โ const double
- nan โ const double
- negativeInfinity โ const double