FloatingPoint.inf constructor

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

Construct a FloatingPoint that represents infinity.

Implementation

factory FloatingPoint.inf(
    {required int exponentWidth,
    required int mantissaWidth,
    Logic? sign,
    bool negative = 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);
}