Integer addition

After integer addition, you learned subtraction. White the algorithm for subtracting a smaller positive integer from a smaller positive integer.

Algorithm X.2: Subtracting a larger positive integer from a smaller positive integer

If $N > M > 0$, to calculate $M - N$, we do the following:

  1. Apply Algorithm X.1 to subtract $M$ from $N$ and let this difference be $S$.
  2. Negate the result $-S$.

Algorithm X.2: Subtracting a larger positive integer from a smaller positive integer

If $N > M > 0$, to calculate $M - N$, we do the following:

  1. Apply Algorithm X.1 to subtract $M$ from $N$ and let this difference be $S$.
  2. Negate the result $-S$.