Decimal128 class
A 128-bit decimal floating point number.
- Implemented types
Constructors
- Decimal128.fromDouble(double value)
-
Converts a
double
into a Decimal128.factory - Decimal128.fromInt(int value)
-
Converts a
int
into a Decimal128.factory - Decimal128.parse(String source)
-
Parses a string into a Decimal128. Throws a FormatException if the string is not a valid Decimal128.
factory
Properties
Methods
-
abs(
) → Decimal128 -
Returns the absolute value of
this
. -
compareTo(
Decimal128 other) → int -
Compares
this
toother
.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toInt(
) → int -
Converts
this
to anint
. Possibly loosing precision. -
toString(
) → String -
String representation of
this
.override
Operators
-
operator *(
Decimal128 other) → Decimal128 -
Multiplies
this
withother
and returns a new Decimal128. -
operator +(
Decimal128 other) → Decimal128 -
Adds
this
withother
and returns a new Decimal128. -
operator -(
Decimal128 other) → Decimal128 -
Subtracts
other
fromthis
and returns a new Decimal128. -
operator /(
Decimal128 other) → Decimal128 -
Divides
this
byother
and returns a new Decimal128. -
operator <(
Decimal128 other) → bool -
Returns
true
ifthis
is less thanother
. -
operator <=(
Decimal128 other) → bool -
Returns
true
ifthis
is less than or equal toother
. -
operator ==(
Object other) → bool -
Returns
true
ifthis
andother
are equal.override -
operator >(
Decimal128 other) → bool -
Returns
true
ifthis
is greater thanother
. -
operator >=(
Decimal128 other) → bool -
Returns
true
ifthis
is greater than or equal toother
. -
operator unary-(
) → Decimal128 -
Negates
this
and returns a new Decimal128.
Static Properties
- infinity → Decimal128
-
The value +Inf.
final
- nan → Decimal128
-
The value NaN.
final
- negativeInfinity → Decimal128
-
The value -Inf.
final
- one → Decimal128
-
The value 1.
final
- ten → Decimal128
-
The value 10.
final
- zero → Decimal128
-
The value 0.
final
Static Methods
-
tryParse(
String source) → Decimal128? -
Parses a string into a Decimal128. Returns
null
if the string is not a valid Decimal128.