I property Null safety

NormalOperation I
final

The HP 16's I operation, related to the index register

Implementation

static final NormalOperation I = NormalOperation(
    pressed: (ActiveState s) => s.liftStackIfEnabled(),
    calc: (Model m) {
      final v = m.memory.registers.index;
      if (m.isFloatMode) {
        v.asDouble; // Throw CalculatorError if not
      }
      m.x = v;
      m.display.displayX();
    },
    name: 'I');