Skip to content

Instantly share code, notes, and snippets.

@joaojeronimo
Created October 24, 2013 02:12
Show Gist options
  • Save joaojeronimo/7130174 to your computer and use it in GitHub Desktop.
Save joaojeronimo/7130174 to your computer and use it in GitHub Desktop.
Monte Carlo Pi on CrowdProcess
function Run () {
var n = 2*1e7;
var inside = 0;
while (n--) {
if (Math.pow(Math.random(), 2) +
Math.pow(Math.random(), 2) < 1)
inside++;
}
return inside;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment