Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created April 2, 2020 16:48
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 johnmyleswhite/7e0418bbd0ed370e6b587b4997dce97c to your computer and use it in GitHub Desktop.
Save johnmyleswhite/7e0418bbd0ed370e6b587b4997dce97c to your computer and use it in GitHub Desktop.
function prob_f64(n)
s = 0
for _ in 1:n
z_i = rand(UInt)
x_i = reinterpret(Float64, z_i)
s += Int(x_i == x_i + 1.0)
end
s, n
end
prob_f64(1_000_000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment