Created
June 16, 2011 16:32
-
-
Save simonbaird/1029636 to your computer and use it in GitHub Desktop.
tau.rb
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| $ 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