Last active
August 29, 2015 13:57
-
-
Save pqcfox/9561857 to your computer and use it in GitHub Desktop.
Happy 1/2 Tau Day! Here's a 1/2 tau generator for those of you who enjoy such things.
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
n = 9001 | |
total = 0.0 | |
for k in range(1, n+1): | |
total += (-1.0)**(k+1.0)/(2.0*k-1.0) | |
print "Using {0} terms of the series:".format(n) | |
print "Half-tau (a.k.a. pi) ≈ {0}".format(total * 4) | |
print "Tau ≈ {0}".format(total * 8) | |
print "Happy 1/2 Tau Day! Visit halftauday.com!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment