InferenceNumericFormat.signedInteger constructor

InferenceNumericFormat.signedInteger(
  1. int width, {
  2. int? productWidth,
  3. int? accumulatorWidth,
  4. NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven,
  5. NumericOverflowMode overflowMode = NumericOverflowMode.saturate,
})

Creates a signed integer inference format.

Implementation

factory InferenceNumericFormat.signedInteger(
  int width, {
  int? productWidth,
  int? accumulatorWidth,
  NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven,
  NumericOverflowMode overflowMode = NumericOverflowMode.saturate,
}) {
  final resolvedProductWidth = productWidth ?? width * 2;
  return InferenceNumericFormat(
    elementKind: InferenceElementKind.signedInteger,
    elementWidth: width,
    productWidth: resolvedProductWidth,
    accumulatorWidth: accumulatorWidth ?? resolvedProductWidth,
    signed: true,
    roundingMode: roundingMode,
    overflowMode: overflowMode,
  );
}