Baking-Pi Challenge - Understanding & Improving
I spent some time yesterday writing the solution for this challenge published on Reddit , and was able to get through it without cheating, but I was left with a couple of questions. Reference material here . This is my code. (ns baking-pi.core (:import java.math.MathContext)) (defn modpow [n e m] (.modPow (biginteger n) (biginteger e) (biginteger m))) (defn div [top bot] (with-precision 34 :rounding HALF_EVEN (/ (bigdec top) (bigdec bot)))) (defn pow [n e] (.pow (bigdec n) (bigdec e) MathContext/DECIMAL128)) (defn round ([n] (.round (bigdec n) MathContext/DECIMAL128)) ([n & args] (->> [n args]