Created
December 13, 2008 21:09
-
-
Save ivyl/35545 to your computer and use it in GitHub Desktop.
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
#PI 1 + 1000 numbers | |
p -4*(0..10**9).inject{|r,e|r+(10**1000*(-1)**e/(2*e-1))} | |
#E 1 + 1000 numbers | |
p (1..10**3).inject(0){|r,e|r+(e==1?2:1)*(10**1000)/(1..e).inject{|r,e|r*e}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment