How can I do exponentiation in clojure? For now I\'m only needing integer exponentiation, but the question goes for fractions too.
SICP inspired full iterative fast version of 'sneaky' implementation above.
(defn fast-expt-iter [b n] (let [inner (fn [a b n] (cond (= n 0) a (even? n) (recur a (* b b) (/ n 2)) :else (recur (* a b) b (- n 1)))) ] (inner 1 b n)))