dart:core
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.
See also:
- Inheritance
-
Constructors
- double()
Properties
- hashCode → int
read-only, inherited
- Returns a hash code for a numerical value.
- isFinite → bool
read-only, inherited
- Whether this number is finite.
- isInfinite → bool
read-only, inherited
- Whether this number is positive infinity or negative infinity.
- isNaN → bool
read-only, inherited
- Whether this number is a Not-a-Number value.
- isNegative → bool
read-only, inherited
- Whether this number is negative.
- runtimeType → Type
read-only, inherited
- A representation of the runtime type of the object.
- sign → double
read-only, override
- 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 that 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 by other. - 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 this number is numerically smaller than
other. - operator <=(num other) → bool
inherited
- Whether this number is numerically smaller than or equal to
other. - operator ==(Object other) → bool
inherited
- Test whether this value is numerically equal to
other. - operator >(num other) → bool
inherited
- Whether this number is numerically greater than
other. - operator >=(num other) → bool
inherited
- Whether this number is numerically greater than or equal to
other. - 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 a double literal and return its value. - tryParse(String source) → double?
override
- Parse
source as a 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