SICP/util.scm
2020-10-19 21:36:17 -04:00

14 lines
264 B
Scheme

(define (assert a b)
(cond ((equal? a b) (display "[ok]"))
(else
(display "[error] ")
(display a)
(display " != ")
(display b)))
(newline))
(define (gcd a b)
(if (= b 0) (abs a) (gcd b (remainder a b))))
;(assert (gcd 93 15) 3)