Natural number division function
Example Forms: (nonnegative-integer-quotient 14 3) ; equals 4 (nonnegative-integer-quotient 15 3) ; equals 5
The guard of
Function:
(defun nonnegative-integer-quotient (i j) (declare (xargs :guard (and (integerp i) (not (< i 0)) (integerp j) (< 0 j)))) (if (or (= (nfix j) 0) (< (ifix i) j)) 0 (+ 1 (nonnegative-integer-quotient (- i j) j))))