post-scarcity/lisp/expt.lisp
Simon Brooke 3fd322af6f Major progress, multiply now almost works
There's a premature free() somewhere, and I'm not sure why.

Print depends on divide, which is easy, but also on mod and floor (of rationals) which isn't.
2019-01-21 16:14:25 +00:00

10 lines
218 B
Common Lisp

(set! expt (lambda
(n x)
"Return the value of `n` raised to the `x`th power."
(cond
((= x 1) n)
(t (* n (expt n (- x 1)))))))
(inspect expt)
(expt 2 59)