Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn pi [ndepthp]
- (loop [nval 4 ndenom 3 ndepth ndepthp]
- (let [nadd (/ 4 ndenom) faddsub (if (== (mod (bit-shift-right (dec ndenom) 1) 2) 0)(+ nval nadd )(- nval nadd))]
- (if (== ndepth 1)
- faddsub
- (recur faddsub (+ 2 ndenom) (dec ndepth))))))
- (enable-console-print!)
- (println "Hello ClojureScript!")
- (println (time (pi 50000000)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement