diff --git a/mes.c b/mes.c index 4b099afe..54faf6dc 100644 --- a/mes.c +++ b/mes.c @@ -1168,6 +1168,14 @@ divide (scm *x/*...*/) return make_number (n); } +scm * +modulo (scm *a, scm *b) +{ + assert (a->type == NUMBER); + assert (b->type == NUMBER); + return make_number (a->value % b->value); +} + scm * multiply (scm *x/*...*/) { diff --git a/scm.mes b/scm.mes index e4520e8e..57afb211 100755 --- a/scm.mes +++ b/scm.mes @@ -174,6 +174,8 @@ (or (> a b) (= a b))) +(define quotient /) + (define (list? x) (or (null? x) (and (pair? x) (list? (cdr x)))))