| f(x,y) | = | x/y if x>0 and y≠0 |
| = | 0 otherwise |
Using just an if expression:
(define f
(lambda (x y)
(if (> x 0)
(if (not (= y 0))
(/ x y)
0)
0)))
|
Using an if and and expression:
(define f
(lambda (x y)
(if (and (> x 0)
(not (= y 0)))
(/ x y)
0)))
|