Skip to content

Instantly share code, notes, and snippets.

@catatsuy
Created December 13, 2015 12:57
Show Gist options
  • Save catatsuy/1cefc355e5f9806bd2c6 to your computer and use it in GitHub Desktop.
Save catatsuy/1cefc355e5f9806bd2c6 to your computer and use it in GitHub Desktop.
N = 2**60
r = 1.0
(1..7000000).each do |i|
r *= ((N.to_f - i + 1) / N)
end
p 1 - r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment