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

hashCode int
The hash code for this object.
no setterinherited
isNaN bool
Returns true if this is NaN.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

abs() Decimal128
Returns the absolute value of this.
compareTo(Decimal128 other) int
Compares this to other.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toInt() int
Converts this to an int. Possibly loosing precision.
toString() String
String representation of this.
override

Operators

operator *(Decimal128 other) Decimal128
Multiplies this with other and returns a new Decimal128.
operator +(Decimal128 other) Decimal128
Adds this with other and returns a new Decimal128.
operator -(Decimal128 other) Decimal128
Subtracts other from this and returns a new Decimal128.
operator /(Decimal128 other) Decimal128
Divides this by other and returns a new Decimal128.
operator <(Decimal128 other) bool
Returns true if this is less than other.
operator <=(Decimal128 other) bool
Returns true if this is less than or equal to other.
operator ==(Object other) bool
Returns true if this and other are equal.
override
operator >(Decimal128 other) bool
Returns true if this is greater than other.
operator >=(Decimal128 other) bool
Returns true if this is greater than or equal to other.
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.