Assuming P0 < M, if Pi = M then that tissue compartment can never on-gas to M either. P will asymptotically approach M but never technically get there. You certainly can't exceed M.
Therefore, when P0<M you can check Pi <= M and, if true, then you can set the NDL to 999 (or whatever number...