FloatingPointValue.withMappedSubtype constructor
- required LogicValue sign,
- required LogicValue exponent,
- required LogicValue mantissa,
Constructs a FloatingPointValue with a sign, exponent, and mantissa using one of the builders provided from subtypeConstructorMap if available, otherwise using the default constructor.
Implementation
factory FloatingPointValue.withMappedSubtype(
{required LogicValue sign,
required LogicValue exponent,
required LogicValue mantissa}) {
final key = (exponentWidth: exponent.width, mantissaWidth: mantissa.width);
if (subtypeConstructorMap.containsKey(key)) {
return subtypeConstructorMap[key]!(
sign: sign, exponent: exponent, mantissa: mantissa);
}
return FloatingPointValue(
sign: sign, exponent: exponent, mantissa: mantissa);
}