Skip to content

Instantly share code, notes, and snippets.

@pqcfox
Last active August 29, 2015 13:57
Show Gist options
  • Save pqcfox/9561857 to your computer and use it in GitHub Desktop.
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.
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