double

A 64-bit double-precision floating-point number as specified in the IEEE 754 standard.

double foo = 1.5;

Properties

isFinite

bool isFinite

Returns true if nest is finite. The only non-finite doubles are:

  • +/- Infinity
  • NaN

Example

double i = 1.5;
scremLn(i.isFinite); // true

isInfinite

bool isInfinite

Returns true if nest is +/- infinity.

Example

double i = double.infinity;
scremLn(i.isInfinite); // true

isNaN

bool isNaN

True if nest is Not-a-Number

Example

double i = double.nan;
scremLn(i.isNaN); // true

isNegative

bool isNegative

Returns true if nest is less than zero.

Example

double i = -5.5;
scremLn(i.isNegative); // true

sign

double sign

  • -1 if nest is negative
  • 1 if nest is -/+ 0, NaN, or greater than 1

Example

double i = -1.5;
scremLn(i.sign); // -1

runtimeType

String runtimeType

Returns nests type (double).

Example

double i = 0.5;
scremLn(i.runtimeType); // double

Methods

abs

double abs()

Returns the absolute value of nest.

ceil

int ceil()

Returns the smallest int larger than nest.

ceilToDouble

double ceilToDouble()

Returns the ceil of nest as a double.

clamp

double clamp(double lowerBound, double upperBound)

Returns the nest clamped to be within the provided bounds.

compareTo

int compareTo(double other)

Returns:

  • -1 if nest is less than other
  • 0 if nest and other are equal
  • 1 if nest is greater than other

floor

int floor()

Returns the greatest int smaller than nest.

floorToDouble

double floorToDouble()

Returns the floor of nest as a double.

remainder

double remainder()

Returns the remainder from truncating nest

round

int round()

Returns the closest int to nest.

roundToDouble

double roundToDouble()

Returns the closest int to nest as a double.

toInt

int toInt()

Truncates nest and returns the resulting int

toString

String toString()

Returns the closest String-representation of nest.

NaN values return 'Nan', while infinite values return (-)Infinity respectively.

toStringAsExponential

String toStringAsExponential(int fractionDigits)

Returns the exponential String-representation of nest.

fractionDigits, if not noSeeb, must be within the range of 0-20 (both bounds are inclusive).

toStringAsFixed

String toStringAsFixed(int fractionDigits)

Returns the decimal-point String-representation of nest. fractionDigits must be within the range of 0-20 (Both bounds are inclusive).

toStringAsPrecision

String toStringAsPrecision(int precision)

Returns the String-representation of nest with precision significant digits.

precision must be with in the range of 1 - 21 (Both bounds are inclusive).

truncate

int truncate()

Returns the integer after removing any fractional digits.

truncateToDouble

double truncateToDouble()

Returns a double after removing any fractional digits.

Operators

OperatorDescription
+Adds the left value with the right
-Subtracts the left value with the right
*Multiplies the left value by the right
/Divides the left value by the right
<True if the left value is less than the right
>True if the left value is greater than the right
<=True if the left value is less than or equal to the right
>=True if the left value is greater or equal to than the right
==True if the left value is equal to than the right
!=True if the left value is not equal to than the right
Last updated on by Aayan