FloatingPointValuePopulator<FpvType extends FloatingPointValue> class

A populator for FloatingPointValues, a utility that can populate various forms of FloatingPointValues.

Implementers

Constructors

FloatingPointValuePopulator(FpvType _unpopulated)
Creates a FloatingPointValuePopulator for the given _unpopulated FloatingPointValue.

Properties

bias → int
The bias of floating point value.
no setter
explicitJBit → bool
true if the format stores the Jbit explicitly.
no setter
exponentWidth → int
The width of the exponent field.
no setter
hashCode → int
The hash code for this object.
no setterinherited
mantissaWidth → int
The width of the mantissa field.
no setter
maxExponent → int
The maximum exponent value.
no setter
minExponent → int
The minimum exponent value.
no setter
nan → FpvType
Creates a new FloatingPointValue representing FloatingPointConstants.nan.
no setter
negativeInfinity → FpvType
Creates a new FloatingPointValue representing FloatingPointConstants.negativeInfinity.
no setter
negativeZero → FpvType
Creates a new FloatingPointValue representing FloatingPointConstants.negativeZero.
no setter
one → FpvType
Creates a new FloatingPointValue representing FloatingPointConstants.one.
no setter
positiveInfinity → FpvType
Creates a new FloatingPointValue representing FloatingPointConstants.positiveInfinity.
no setter
positiveZero → FpvType
Creates a new FloatingPointValue representing FloatingPointConstants.positiveZero.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subNormalAsZero → bool
true if subnormal numbers are treated as zero.
no setter

Methods

add(FloatingPointValue a, FloatingPointValue b, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Adds a and b exactly and rounds once into this format.
divide(FloatingPointValue a, FloatingPointValue b, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Divides a by b exactly (to sufficient precision) and rounds once into this format.
getConstantComponents(FloatingPointConstants constant) → ({LogicValue exponent, LogicValue mantissa, LogicValue sign})
Return the set of LogicValues for a given FloatingPointConstants at a given exponentWidth and mantissaWidth.
multiply(FloatingPointValue a, FloatingPointValue b, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Multiplies a and b exactly and rounds once into this format.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ofBigInts(BigInt exponent, BigInt mantissa, {bool sign = false}) → FpvType
FloatingPointValue constructor from a set of BigInts of the binary representation and the size of the exponent and mantissa
ofBinaryStrings(String sign, String exponent, String mantissa) → FpvType
FloatingPointValue constructor from a binary string representation of individual bitfields
ofConstant(FloatingPointConstants constantFloatingPoint) → FpvType
Creates a new FloatingPointValue represented by the given constantFloatingPoint.
ofDouble(double inDouble, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Convert from double using its native binary representation.
ofDoubleLegacy(double inDouble, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Convert from double using its native binary representation.
ofFixedPointValue(FixedPointValue fxv, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Converts fxv directly into this floating-point format.
ofFloatingPoint(FloatingPoint fp) → FpvType
Extracts a FloatingPointValue from a FloatingPoint's current value.
ofFloatingPointPrevious(FloatingPoint fp) → FpvType?
Extracts a FloatingPointValue from a FloatingPoint's previousValue.
ofFloatingPointValue(FloatingPointValue fpv, {bool canonicalizeExplicit = false}) → FloatingPointValue
Convert to from one FloatingPointValue to another, canonicalizing the mantissa as requested if the output FloatingPointValue has an explicit J bit.
ofFloatingPointValueRounded(FloatingPointValue fpv, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Converts fpv directly to this format with one exact rounding step.
ofInts(int exponent, int mantissa, {bool sign = false}) → FpvType
FloatingPointValue constructor from a set of ints of the binary representation and the size of the exponent and mantissa
ofLogicValue(LogicValue val) → FpvType
Construct a FloatingPointValue from a LogicValue
ofScaledBigInt(BigInt significand, int exponent, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Constructs a value equal to significand times two to exponent.
ofSpacedBinaryString(String fp) → FpvType
FloatingPointValue constructor from a single binary string representing space-separated bitfields in the order of sign, exponent, mantissa.
ofString(String fp, {int radix = 2}) → FpvType
FloatingPointValue constructor from a radix-encoded string representation and the size of the exponent and mantissa
populate({required LogicValue sign, required LogicValue exponent, required LogicValue mantissa}) → FpvType
Populates the FloatingPointValue with the given sign, exponent, and mantissa, then performs additional validation.
random(Random rv, {bool genNormal = true, bool genSubNormal = true, bool excludeInfinity = false, FpvType? gt, FpvType? lt, FpvType? gte, FpvType? lte}) → FpvType
Generate a random FloatingPointValue, using random seed rv in a given range, if provided. The distribution of values is uniform across the combined bitfield of exponent and mantissa.
squareRoot(FloatingPointValue value, {FloatingPointRoundingMode roundingMode = FloatingPointRoundingMode.roundNearestEven}) → FpvType
Computes square root exactly and rounds once into this format.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited