Example 12 If $m$ and $n$ are positive integers, and $m \leqslant$ $1996, r=2-\frac{m}{n}>0$, then the minimum value of $r$ is $\qquad$
(1996, Shanghai Junior High School Mathematics Competition)
Solution: From $r=2-\frac{m}{n}>0$, we get $\frac{m}{n}<2$.
If we take $m=1996, n=999$,
then $\frac{m}{n}=\frac{1996}{999}$;
If we take $m=1995, n=998$,
then $\frac{m}{n}=\frac{1995}{998}$;
Clearly, $\frac{1995}{998}>\frac{1996}{999}$.
If we take $m=1994, n=998$, then $\frac{m}{n}=\frac{1994}{998}$;
If we take $m=1993, n=997$,
then $\frac{m}{n}=\frac{1993}{997}$;
Clearly, $\frac{1993}{997}>\frac{1994}{998}$.
If we take $m=2, n=2$, then $\frac{m}{n}=\frac{2}{2}$;
If we take $m=1, n=1$, then $\frac{m}{n}=\frac{1}{1}$;
Clearly, $\frac{1995}{998}>\frac{1993}{997}>\cdots>\frac{1}{1}$.
Thus, when we take $m=1995, n=998$, the value of $\frac{m}{n}$ is the largest.
Therefore, the minimum value of $r$ is $2-\frac{1995}{998}=\frac{1}{998}$.