scm.mes: add expt.
This commit is contained in:
parent
9fc7868a6d
commit
bbdba26201
5
scm.mes
5
scm.mes
|
@ -185,6 +185,11 @@
|
|||
(define (remainder x y)
|
||||
(- x (* (/ x y) y)))
|
||||
|
||||
(define (expt x y)
|
||||
(let loop ((s 1) (count y))
|
||||
(if (= 0 count) s
|
||||
(loop (* s x) (- count 1)))))
|
||||
|
||||
(define (max x . rest)
|
||||
(if (null? rest) x
|
||||
(let* ((y (car rest))
|
||||
|
|
Loading…
Reference in a new issue