double class
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 read-only, inherited
- Returns a hash code for a numerical value. [...]
- isFinite → bool read-only, inherited
- Whether the number is finite. [...]
- isInfinite → bool read-only, inherited
- Whether the number is positive infinity or negative infinity.
- isNaN → bool read-only, inherited
- Whether the number is the double Not-a-Number value.
- isNegative → bool read-only, inherited
- Whether if the number is negative. [...]
- runtimeType → Type read-only, inherited
- A representation of the runtime type of the object.
- sign → double read-only, override
- Returns the sign of the double's numerical value. [...]
Methods
- abs(
) → double override - The absolute value of this number. [...]
- ceil(
) → int override - Returns the least integer which is not smaller than this number. [...]
- ceilToDouble(
) → double override - Returns the least integer double value no smaller than
this
. [...] - clamp(
num lowerLimit, num upperLimit) → num inherited - Returns this num clamped to be in the range
lowerLimit
-upperLimit
. [...] - compareTo(
num other) → int inherited - Compares this to
other
. [...] - floor(
) → int override - Returns the greatest integer no greater than this number. [...]
- floorToDouble(
) → double override - Returns the greatest integer double value no greater than
this
. [...] - noSuchMethod(
Invocation invocation) → dynamic inherited - Invoked when a non-existent method or property is accessed. [...]
- remainder(
num other) → double override - The remainder of the truncating division of
this
byother
. [...] - round(
) → int override - Returns the integer closest to this number. [...]
- roundToDouble(
) → double override - Returns the integer double value closest to
this
. [...] - toDouble(
) → double inherited - This number as a double. [...]
- toInt(
) → int inherited - Truncates this num to an integer and returns the result as an int. [...]
- toString(
) → String override - Provide a representation of this double value. [...]
- toStringAsExponential(
[int? fractionDigits]) → String inherited - An exponential string-representation of this number. [...]
- toStringAsFixed(
int fractionDigits) → String inherited - A decimal-point string-representation of this number. [...]
- toStringAsPrecision(
int precision) → String inherited - A string representation with
precision
significant digits. [...] - truncate(
) → int override - Returns the integer obtained by discarding any fractional part of this number. [...]
- truncateToDouble(
) → double override - Returns the integer double value obtained by discarding any fractional digits from
this
. [...]
Operators
- operator %(
num other) → double override - Euclidean modulo of this number by
other
. [...] - operator *(
num other) → double override - Multiplies this number by
other
. [...] - operator +(
num other) → double override - Adds
other
to this number. [...] - operator -(
num other) → double override - Subtracts
other
from this number. [...] - operator /(
num other) → double override - Divides this number by
other
. - operator <(
num other) → bool inherited - Whether
other
is numerically smaller than this number. [...] - operator <=(
num other) → bool inherited - Whether
other
is numerically smaller than or equal to this number. [...] - operator ==(
Object other) → bool inherited - Test whether this value is numerically equal to
other
. [...] - operator >(
num other) → bool inherited - Whether
other
is numerically greater than this number. [...] - operator >=(
num other) → bool inherited - Whether
other
is numerically greater than or equal to this number. [...] - operator unary-(
) → double override - The negation of this value. [...]
- operator ~/(
num other) → int override - Truncating division operator. [...]
Static Methods
- parse(
String source, [double onError(String source)]) → double override - Parse
source
as an double literal and return its value. [...] - tryParse(
String source) → double? override - Parse
source
as an double literal and return its value. [...]
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
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-core/double-class.html