Skip to content

Instantly share code, notes, and snippets.

@mpickering
Created May 6, 2012 23:39
Show Gist options
  • Save mpickering/2625015 to your computer and use it in GitHub Desktop.
Save mpickering/2625015 to your computer and use it in GitHub Desktop.
pi approximation
len([1 for x,y in [[random.random() for t in range(2)] for i in range(1000000)] if math.sqrt(x**2+y**2)<=1])/250000.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment