(require "numbers.BRU") (require "logic.BRU") (require "ordering.BRU") ; keep subtracting the divisor from the dividend until the result becomes less than the divisor. ; division by zero -> #t, FIXME is that nice? [(int/-impl (\int/ (\dividend (\divisor (cond ((zero? divisor) #t) ((< dividend divisor) 0) (else (succ (int/ (- dividend divisor) divisor)))))))) ; FIXME faster version would be to subtract the bigger one at times and divide by 2 each time. Not sure... (remainder-impl (\remainder (\dividend (\divisor (cond ((zero? divisor) #t) ; TODO error. ((< dividend divisor) dividend) (else (remainder (- dividend divisor) divisor)))))))]