ofConstant method
- FloatingPointConstants constantFloatingPoint
Creates a new FloatingPointValue represented by the given
constantFloatingPoint
.
Implementation
FpvType ofConstant(FloatingPointConstants constantFloatingPoint) {
if (explicitJBit) {
return ofFloatingPointValue(FloatingPointValue.populator(
exponentWidth: exponentWidth, mantissaWidth: mantissaWidth - 1)
.ofConstant(constantFloatingPoint)) as FpvType;
}
final components =
// ignore: invalid_use_of_visible_for_overriding_member, invalid_use_of_protected_member
_unpopulated.getSpecialConstantComponents(constantFloatingPoint) ??
getConstantComponents(constantFloatingPoint);
return populate(
sign: components.sign,
exponent: components.exponent,
mantissa: components.mantissa);
}