Skip to content

Instantly share code, notes, and snippets.

@cgrand
Last active November 7, 2016 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgrand/d5dbc75d14b46108215fdd5af0e30609 to your computer and use it in GitHub Desktop.
Save cgrand/d5dbc75d14b46108215fdd5af0e30609 to your computer and use it in GitHub Desktop.
(defn mid [a b] (/ (+ a b) 2.0))
(count (take-while #(not= 1.0 %) (iterate #(mid 1 %) 2)))
=> 53
; 53 is not random but tied to the fact that the fraction part of a double is stored on 52 bits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment