FloatingPointValuePopulator<FpvType extends FloatingPointValue> class
A populator for FloatingPointValues, a utility that can populate various forms of FloatingPointValues.
Constructors
- FloatingPointValuePopulator.new(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
-
getConstantComponents(
FloatingPointConstants constant) → ({LogicValue exponent, LogicValue mantissa, LogicValue sign}) - Return the set of LogicValues for a given FloatingPointConstants at a given exponentWidth and mantissaWidth.
-
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
-
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.
-
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
-
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
, andmantissa
, then performs additional validation. -
random(
Random rv, {bool normal = false, bool subNormal = false, 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. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited