FloatingPoint.inf constructor

FloatingPoint.inf({
  1. required int exponentWidth,
  2. required int mantissaWidth,
  3. Logic? sign,
  4. bool negative = false,
  5. bool explicitJBit = false,
  6. bool subNormalAsZero = false,
})

Construct a FloatingPoint that represents infinity.

Implementation

factory FloatingPoint.inf(
    {required int exponentWidth,
    required int mantissaWidth,
    Logic? sign,
    bool negative = false,
    bool explicitJBit = false,
    bool subNormalAsZero = false}) {
  final signLogic = Logic()..gets(sign ?? Const(negative));
  final exponent = Const(1, width: exponentWidth, fill: true);
  final mantissa = Const(0, width: mantissaWidth, fill: true);
  return FloatingPoint._(
      signLogic, exponent, mantissa, explicitJBit, subNormalAsZero);
}