reciprocal property Null safety

NormalOperation reciprocal
final

Implementation

static final NormalOperation reciprocal = NormalOperation.floatOnly(
    floatCalc: (Model m) {
      double x = m.xF;
      if (x == 0.0) {
        throw CalculatorError(0);
      } else {
        m.floatOverflow = false;
        m.resultXF = 1.0 / x;
      }
    },
    name: '1/x');