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

Define the TAU circle constant [Feature #4897] #644

Closed
wants to merge 1 commit into
base: trunk
from

Conversation

5 participants
@simonbaird

simonbaird commented Jun 28, 2014

  • Define TAU constant in math.c similar to PI.
  • Define TAU method in bigdecimal/math based on existing
    PI method.
@simonbaird

This comment has been minimized.

Show comment
Hide comment
@simonbaird

simonbaird Jun 28, 2014

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)'
3.141592653589793
0.3141592653589793238462643383279502884519859293521427E1
6.283185307179586
0.6283185307179586476925286766559005769039718587042854E1

simonbaird commented Jun 28, 2014

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)'
3.141592653589793
0.3141592653589793238462643383279502884519859293521427E1
6.283185307179586
0.6283185307179586476925286766559005769039718587042854E1

@simonbaird

This comment has been minimized.

Show comment
Hide comment

simonbaird commented Jun 28, 2014

Show outdated Hide outdated ext/bigdecimal/lib/bigdecimal/math.rb
@@ -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

This comment has been minimized.

@simonbaird

simonbaird Jun 28, 2014

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.

@simonbaird

simonbaird Jun 28, 2014

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.

nobu added a commit that referenced this pull request Jun 28, 2014

bigdecimal/math.rb: error message in BigMath#PI
* 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
@simonbaird

This comment has been minimized.

Show comment
Hide comment
@simonbaird

simonbaird Jun 28, 2014

Rebased on top of 38f0133 "bigdecimal/math.rb: error message in BigMath#PI"

simonbaird commented Jun 28, 2014

Rebased on top of 38f0133 "bigdecimal/math.rb: error message in BigMath#PI"

@thoran

This comment has been minimized.

Show comment
Hide comment
@thoran

thoran Jul 6, 2014

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 commented Jul 6, 2014

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...

@simonbaird

This comment has been minimized.

Show comment
Hide comment
@simonbaird

simonbaird Jul 19, 2014

@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.. :)

simonbaird commented Jul 19, 2014

@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.. :)

mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Aug 10, 2014

bigdecimal/math.rb: error message in BigMath#PI
* 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
Define the TAU circle constant [Feature #4897]
* 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.

@hsbt hsbt assigned mrkn Jul 9, 2015

@mrkn

This comment has been minimized.

Show comment
Hide comment
@mrkn

mrkn Jul 9, 2015

Contributor

@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.

Contributor

mrkn commented Jul 9, 2015

@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.

@simonbaird

This comment has been minimized.

Show comment
Hide comment
@simonbaird

simonbaird Jul 10, 2015

@mrkn Take a look here. It shows a year by year list of Tau related highlights including some books and publications that use it.

simonbaird commented Jul 10, 2015

@mrkn Take a look here. It shows a year by year list of Tau related highlights including some books and publications that use it.

@simonbaird

This comment has been minimized.

Show comment
Hide comment

simonbaird commented Jul 10, 2015

Google calculator has Tau: https://www.google.com/search?q=tau+%2B+0

@gogotanaka

This comment has been minimized.

Show comment
Hide comment
@gogotanaka

gogotanaka Jul 10, 2015

Member

@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.
But I really doubt whether it worth having tau as constant in Ruby. There are a lot of other math constants which are also important. And E and PI are top two of special one, very special. While Nobody complain about having E and PI as constant, discussing about how important other constants(Tau) is and worth it are kind of difficult.

Member

gogotanaka commented Jul 10, 2015

@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.
But I really doubt whether it worth having tau as constant in Ruby. There are a lot of other math constants which are also important. And E and PI are top two of special one, very special. While Nobody complain about having E and PI as constant, discussing about how important other constants(Tau) is and worth it are kind of difficult.

@simonbaird

This comment has been minimized.

Show comment
Hide comment
@simonbaird

simonbaird Jul 13, 2015

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:

  • It won't hurt anyone
  • It can help further the acceptance and adoption of Tau (which I believe is a good thing for the world)

How about asking "why not" instead of "why"?

simonbaird commented Jul 13, 2015

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:

  • It won't hurt anyone
  • It can help further the acceptance and adoption of Tau (which I believe is a good thing for the world)

How about asking "why not" instead of "why"?

@mrkn

This comment has been minimized.

Show comment
Hide comment
@mrkn

mrkn Jul 20, 2015

Contributor

@simonbaird I decided to reject this proposal. The reasons is:

  • It looks to me that tau as the circle constant isn't popular enough to be introduced in Ruby's core although it has good property.
  • So introducing tau is hurt the future Ruby now. Core constants cannot remove easily.
  • It's not Ruby's role to help further the acceptance and adoption of tau.
  • I found that Python and Julia rejected similar proposals. See https://bugs.python.org/issue12345 and JuliaLang/julia#4864.
Contributor

mrkn commented Jul 20, 2015

@simonbaird I decided to reject this proposal. The reasons is:

  • It looks to me that tau as the circle constant isn't popular enough to be introduced in Ruby's core although it has good property.
  • So introducing tau is hurt the future Ruby now. Core constants cannot remove easily.
  • It's not Ruby's role to help further the acceptance and adoption of tau.
  • I found that Python and Julia rejected similar proposals. See https://bugs.python.org/issue12345 and JuliaLang/julia#4864.

@mrkn mrkn closed this Jul 20, 2015

@simonbaird

This comment has been minimized.

Show comment
Hide comment
@simonbaird

simonbaird Jul 21, 2015

Okay, your reasoning is very sensible and well explained. Thanks very much for the consideration. Best wishes, Simon.

simonbaird commented Jul 21, 2015

Okay, your reasoning is very sensible and well explained. Thanks very much for the consideration. Best wishes, Simon.

@waldyrious

This comment has been minimized.

Show comment
Hide comment
@waldyrious

waldyrious Feb 10, 2017

I found that Python and Julia rejected similar proposals. See https://bugs.python.org/issue12345 and JuliaLang/julia#4864.

Just FYI, Python actually ended up incorporating the proposal: issue 12345 is now marked as solved -- by Guido himself, no less :)

waldyrious commented Feb 10, 2017

I found that Python and Julia rejected similar proposals. See https://bugs.python.org/issue12345 and JuliaLang/julia#4864.

Just FYI, Python actually ended up incorporating the proposal: issue 12345 is now marked as solved -- by Guido himself, no less :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment