-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
proposal: math: add Tau in constants #40663
Comments
While I am a big fan of tau, I don't see the problem in putting |
I am a mathematician. I've used pi a lot, and tau almost none. Trigonometry isn't the only place where pi arises. Convention and inertia matter as well; schools teach pi largely for historical reasons, but as long as they do, writing 2π, or
This is a false analogy. |
Adding a const to the math package actually won’t break any code. However, the more things that get added, it starts to become hard to search packages, learn the language, etc. It may seem like a relatively small thing to add, but at the same time, I would personally hate for Go to have a constant for every greek letter, haha. |
Are there are any other languages that provide For example, in C, in |
From https://tauday.com/state-of-the-tau :
|
I don't understand all theses thumbs down. I respect your choice of preferring Pi over Tau, but why be against adding Tau? You will probably don't even notice the difference if it's added, and as @deanveloper pointed out, it won't break any code (and of course wont affect performance). There are thousands of issues here, I bet that for 9/10 of them, I just don't care. I'm not going to add a thumb down for all of them. :D So this is not a "Pi vs Tau battle". It's just a suggestion to add a constant that will make some developers happier. You prefer Pi? Lucky you! You have actually nothing to do, there is already
Yes, indead. I can also write at the beginning of a program: const Pi = 3.14159265358979323846264338327950288419716939937510582097494459 Luckily there is
You suggests level down: we don't necessary have to look for other institutions before to addopt an improvement. As @zephyrtronium said, there is a huge inertia with Pi, so it's understandable that Tau is not as present as Pi. A programing language is basically a convention to convert intelligible instructions into machine code: here, for me and other developers, Tau is more intelligible than Pi. Just consider it. Please. :) |
There are people who don't know tau, but know pi. Even if you would find a bit more convenient using math.Tau instead of 2*math.Pi, I'd prefer that all Go code used pi so that every developer can instantly get it. As someone who daily works with angles and orientations, I also have quite strong opinions on why tau is not such a good idea, but I do not think the Go issue tracker is the place to have that discussion. |
In areas where Go has not explicitly decided to develop new ideas, we prefer to follow the lead of other projects. I don't think this is leveling down; it's just being deliberate in making changes. |
Edit: I wrote something but missed a comment above which provides a more complete answer to this question. See also relevant past discussion in proposal #24759. |
Rust. https://doc.rust-lang.org/nightly/std/f64/consts/constant.TAU.html It was stabilized a few weeks back and will be released in Rust 1.47 I believe. As a side note, it seems really strange to me that there would be any resistance to adding this in as a numerical constant, with any language. |
C provides not just Pi but Pi/2 ( If you need to write a program in terms of Tau, then add |
There's a Go package for Tau, whose usage may help provide some metrics in the future : https://github.com/FranklinChen/gotau Closing note, just to clarify, though: it's not about needing to write a program in terms of Tau ; it's about needing to write a program using in any form the topology of a circle. (usually through trigonometry, but the circle is everywhere). |
Great, I am glad that the package has already been created outside the standard library. We can revisit in (say) five years if mathematics has overwhelmingly shifted away from Pi to Tau, but in the meantime, this seems like a likely decline. |
No change in consensus, so declined. |
Add Tau in mathematical constants.
In many cases, formulas can be more elegant using the Tau constant instead
of Pi. You will find a good number of arguments and explanations
in the Tau manifesto, which describes Tau as:
The constant is based on the corresponding page in the online
encyclopedia of integer sequences, and is also
equal to
math.Pi * 2
.Usage:
I just created the PR #40662 that adds the constant, but I'm now creating this issue to have some feedback before signing the CLA.
The text was updated successfully, but these errors were encountered: