Skip to content

Instantly share code, notes, and snippets.

@simonbaird
Created June 16, 2011 16:32
Show Gist options
  • Select an option

  • Save simonbaird/1029636 to your computer and use it in GitHub Desktop.

Select an option

Save simonbaird/1029636 to your computer and use it in GitHub Desktop.
tau.rb
# See http://tauday.com/
module Math
TAU = PI * 2.0
end
if defined? BigMath
module BigMath
module_function
def TAU(prec)
PI(prec) * BigDecimal("2")
end
end
end
$ ruby -I. -r bigdecimal/math -r tau -e 'puts Math::TAU, BigMath.TAU(100)'
6.283185307179586
0.62831853071795864769252867665590057683943387987502116419498891846156328125724179972560696506842341359642961730265646057277261767213856E1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment