next up previous contents
Next: Relational Abstractions Up: Extended Numerical Abstractions Previous: Decrementing a number: `pred'   Contents


Subtracting a number: `sub'

The expression $ m - n$ is evaluated by decrementing $ m$ $ n$-times.

(define sub 
   (lambda (m n)
      ((n pred) m)))


(ndisp! (sub three two))
                             --> 1
(ndisp! (sub four two))
                             --> 2



Georg P. Loczewski 2004-03-05


Impressum und Datenschutz