FloatParts class abstract
Representation of the parts of a binary floating number.
- Annotations
-
- @sealed
Constructors
- FloatParts(int mantissa, int exponent, {bool forceNegative = false})
-
Create the parts for the number
M * 2^E
, where M is themantissa
andE
is theexponent
.factory - FloatParts.fromDouble(double value)
-
Parse FloatParts from a double.
factory
- FloatParts.fromFloat128Bytes(Uint8List bytes, [Endian e = Endian.big])
-
Parse FloatParts from a single IEEE754
float128
encoded as bytes.factory - FloatParts.fromFloat16Bytes(Uint8List bytes, [Endian e = Endian.big])
-
Parse FloatParts from a single IEEE754
float16
encoded as bytes.factory - FloatParts.fromFloat32Bytes(Uint8List bytes, [Endian e = Endian.big])
-
Parse FloatParts from a single IEEE754
float32
encoded as bytes.factory - FloatParts.fromFloat64Bytes(Uint8List bytes, [Endian e = Endian.big])
-
Parse FloatParts from a single IEEE754
float64
encoded as bytes.factory - FloatParts.withBigMantissa(BigInt mantissa, int exponent, {bool forceNegative = false})
-
Create the parts for the number
M * 2^E
, where M is themantissa
andE
is theexponent
.factory
Properties
- exponent → int
-
The exponent for the
M * 2^E
number.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isFloat128Lossless → bool
-
Returns
true
if toFloat128Bytes is lossless.no setter - isFloat16Lossless → bool
-
Returns
true
if toFloat16Bytes is lossless.no setter - isFloat32Lossless → bool
-
Returns
true
if toFloat32Bytes is lossless.no setter - isFloat64Lossless → bool
-
Returns
true
if toFloat64Bytes is lossless.no setter - isInfinite → bool
-
Whether the value is inifinite.
no setter
- isNaN → bool
-
Whether the value is NaN.
no setter
- isNegative → bool
-
Whether the number is negative.
no setter
- mantissa → BigInt
-
The mantissa for the
M * 2^E
number.no setter - mantissaInteger → Integer
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
abs(
) → FloatParts - Returns the absolute value of this number.
-
minimize(
) → FloatParts - Minimize the representation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
roundToExponent(
int val) → FloatParts -
Rounds (or extends) the number such that
exponent == val
. -
roundToMantissa(
int bits) → FloatParts -
Rounds (or extends) the number such that
mantissa.abs().bitLength == bits
. -
toDouble(
) → double - Transform the number into a double.
-
toFloat128Bytes(
[Endian e = Endian.big]) → Uint8List - Encode as IEEE754 float128.
-
toFloat16Bytes(
[Endian e = Endian.big]) → Uint8List - Encode as IEEE754 float16.
-
toFloat32Bytes(
[Endian e = Endian.big]) → Uint8List - Encode as IEEE754 float32.
-
toFloat64Bytes(
[Endian e = Endian.big]) → Uint8List - Encode as IEEE754 float64.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- infinity → const FloatParts
- Representation for infinity.
- nan → const FloatParts
- Representation for NaN.
- negativeInfinity → const FloatParts
- Representation for negative infinity.