Created
July 17, 2014 16:38
-
-
Save hrs/76fd3acbf5d8e44935c7 to your computer and use it in GitHub Desktop.
Probabilistic calculation of pi in 56 characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p (0..1000000).count{rand<Math.sqrt(1-rand**2)}/250000.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment