-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Define the TAU circle constant [Feature #4897] #644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I tested like this: oubliette:~/dev/ruby> [trunk_define_tau] /usr/local/bin/ruby -r bigdecimal/math -e 'puts Math::PI, BigMath.PI(20), Math::TAU, BigMath.TAU(20)' |
Link to issue tracker: |
@@ -180,7 +181,7 @@ def atan(x, prec) | |||
# #=> "0.3141592653589793238462643388813853786957412E1" | |||
# | |||
def PI(prec) | |||
raise ArgumentError, "Zero or negative argument for PI" if prec <= 0 | |||
raise ArgumentError, "Zero or negative precision for PI" if prec <= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you don't like this. I'm happy to leave it as 'argument' if that is preferred. My thoughts are that precision is a better word and it is consistent with the message in the E method below.
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error message about zero or negative precision for clarity and consistency with other methods. [GH-644] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Rebased on top of 38f0133 "bigdecimal/math.rb: error message in BigMath#PI" |
Simon, I think you've erred in putting PI first. Shouldn't TAU be first? Or perhaps they should be in alphabetical order: E, PI, TAU? Thanks for this patch and raising my awareness of Tau. I'm a Tau convert now too... |
@thoran (Not sure if you're totally serious, but) I don't think changing the order is necessary or sensible. Glad to hear Tau has another convert.. :) |
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error message about zero or negative precision for clarity and consistency with other methods. [rubyGH-644] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c: Define TAU constant in similar to PI constant. * ext/bigdecimal/lib/bigdecimal/math.rb: Define TAU method in bigdecimal/math based on existing PI method.
2661af9
to
2b8f97f
Compare
@simonbaird Please tell me how popular is tau in the community of mathematicians and physicians. I don't have any idea of it. I want to know how many research papers or textbooks using this new constant definition have been published as of today. |
Google calculator has Tau: https://www.google.com/search?q=tau+%2B+0 |
@simonbaird Hi! Thank you for working on it. While leaving a decision to @mrkn san, let me say something here. Tau makes more sense than pi to me and is important constant as you show. I personally love this number. |
The two most important constants in mathematics are e and "the circle constant". And, (according to the Tau supporters, myself included), the circle constant is Tau. So that's why I don't think the "slippery slope" argument, i.e. "if we add Tau then people will want to add many other constants" is valid. Nevertheless, I understand the decision about whether to merge this is not a clear one. Here's some of my thoughts why it could be merged:
How about asking "why not" instead of "why"? |
@simonbaird I decided to reject this proposal. The reasons is:
|
Okay, your reasoning is very sensible and well explained. Thanks very much for the consideration. Best wishes, Simon. |
Just FYI, Python actually ended up incorporating the proposal: issue 12345 is now marked as solved -- by Guido himself, no less :) |
Can we please reopen this issue? even iOS messenger and google calculator has TAU now... It makes a lot of maths easier and more intuitive because the definition for the circle constant is then based on radius rather than diameter, same as radians. |
@renewooller I’m not sure how to use TAU in the iOS messenger, and I haven’t been able to confirm whether Google’s calculator supports TAU. As far as I can tell, both Google’s web calculator and Chrome’s built-in calculator only offer pi. Could you please let me know how I can verify that TAU is available in these calculators? By the way, the only criterion for deciding whether TAU can be included as a constant in the Math module is how frequently it appears in academic mathematics papers. |
PI method.