InferenceNumericFormat.floatingPoint constructor
- required int exponentWidth,
- required int mantissaWidth,
- int? productWidth,
- int? accumulatorWidth,
- NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven,
- NumericOverflowMode overflowMode = NumericOverflowMode.saturate,
Creates a floating-point inference format.
Implementation
factory InferenceNumericFormat.floatingPoint({
required int exponentWidth,
required int mantissaWidth,
int? productWidth,
int? accumulatorWidth,
NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven,
NumericOverflowMode overflowMode = NumericOverflowMode.saturate,
}) {
final elementWidth = exponentWidth + mantissaWidth + 1;
final resolvedProductWidth = productWidth ?? elementWidth;
return InferenceNumericFormat(
elementKind: InferenceElementKind.floatingPoint,
elementWidth: elementWidth,
productWidth: resolvedProductWidth,
accumulatorWidth: accumulatorWidth ?? resolvedProductWidth,
signed: true,
exponentWidth: exponentWidth,
mantissaWidth: mantissaWidth,
roundingMode: roundingMode,
overflowMode: overflowMode,
);
}