populator static method

FloatingPointValuePopulator<FloatingPointValue> populator({
  1. required int exponentWidth,
  2. required int mantissaWidth,
  3. bool explicitJBit = false,
  4. bool subNormalAsZero = false,
})

Creates a FloatingPointValuePopulator with the provided exponentWidth and mantissaWidth, which can then be used to complete construction of a FloatingPointValue using population functions.

Implementation

static FloatingPointValuePopulator populator(
    {required int exponentWidth,
    required int mantissaWidth,
    bool explicitJBit = false,
    bool subNormalAsZero = false}) {
  if (explicitJBit && mantissaWidth < 2) {
    throw ArgumentError.value(mantissaWidth, 'mantissaWidth',
        'explicit-J-bit formats require a NaN payload bit');
  }
  return FloatingPointValuePopulator(FloatingPointValue.uninitialized(
      explicitJBit: explicitJBit, subNormalAsZero: subNormalAsZero)
    .._exponentWidth = exponentWidth
    .._mantissaWidth = mantissaWidth);
}