ObjNumExt extension

on

Properties

isFinite bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is finite.
no setter
isInfinite bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is positive infinity or negative infinity.
no setter
isNaN bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is a Not-a-Number value.
no setter
isNegative bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is negative.
no setter
sign num

Available on Obj<num>, provided by the ObjNumExt extension

Negative one, zero or positive one depending on the sign and numerical value of this number.
no setter

Methods

abs() num

Available on Obj<num>, provided by the ObjNumExt extension

The absolute value of this number.
ceil() int

Available on Obj<num>, provided by the ObjNumExt extension

The least integer no smaller than this.
ceilToDouble() double

Available on Obj<num>, provided by the ObjNumExt extension

Returns the least double integer value no smaller than this.
clamp(num lowerLimit, num upperLimit) num

Available on Obj<num>, provided by the ObjNumExt extension

Returns this num clamped to be in the range lowerLimit-upperLimit.
compareTo(num other) int

Available on Obj<num>, provided by the ObjNumExt extension

Compares this to other.
floor() int

Available on Obj<num>, provided by the ObjNumExt extension

The greatest integer no greater than this number.
floorToDouble() double

Available on Obj<num>, provided by the ObjNumExt extension

Returns the greatest double integer value no greater than this.
remainder(num other) num

Available on Obj<num>, provided by the ObjNumExt extension

The remainder of the truncating division of this by other.
round() int

Available on Obj<num>, provided by the ObjNumExt extension

The integer closest to this number.
roundToDouble() double

Available on Obj<num>, provided by the ObjNumExt extension

The double integer value closest to this value.
toDouble() double

Available on Obj<num>, provided by the ObjNumExt extension

This number as a double.
toInt() int

Available on Obj<num>, provided by the ObjNumExt extension

Truncates this num to an integer and returns the result as an int.
toStringAsExponential([int? fractionDigits]) String

Available on Obj<num>, provided by the ObjNumExt extension

An exponential string-representation of this number.
toStringAsFixed(int fractionDigits) String

Available on Obj<num>, provided by the ObjNumExt extension

A decimal-point string-representation of this number.
toStringAsPrecision(int precision) String

Available on Obj<num>, provided by the ObjNumExt extension

A string representation with precision significant digits.
truncate() int

Available on Obj<num>, provided by the ObjNumExt extension

The integer obtained by discarding any fractional digits from this.
truncateToDouble() double

Available on Obj<num>, provided by the ObjNumExt extension

Returns the double integer value obtained by discarding any fractional digits from the double value of this.

Operators

operator %(Obj<num> other) Obj<num>

Available on Obj<num>, provided by the ObjNumExt extension

Euclidean modulo of this number by other.
operator *(Obj<num> other) Obj<num>

Available on Obj<num>, provided by the ObjNumExt extension

Multiplies this number by other.
operator +(Obj<num> other) Obj<num>

Available on Obj<num>, provided by the ObjNumExt extension

Adds other to this number.
operator -(Obj<num> other) Obj<num>

Available on Obj<num>, provided by the ObjNumExt extension

Subtracts other from this number.
operator /(Obj<num> other) Obj<double>

Available on Obj<num>, provided by the ObjNumExt extension

Divides this number by other.
operator <(Obj<num> other) bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is numerically smaller than other.
operator <=(Obj<num> other) bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is numerically smaller than or equal to other.
operator >(Obj<num> other) bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is numerically greater than other.
operator >=(Obj<num> other) bool

Available on Obj<num>, provided by the ObjNumExt extension

Whether this number is numerically greater than or equal to other.
operator unary-() Obj<num>

Available on Obj<num>, provided by the ObjNumExt extension

The negation of this value.
operator ~/(Obj<num> other) Obj<int>

Available on Obj<num>, provided by the ObjNumExt extension

Truncating division operator.