ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: ufuk@paralaus.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:101871] [Ruby master Feature#17496] Add constant Math::TAU
Date: Fri, 01 Jan 2021 22:34:22 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-89708.20210101223421.11075@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17496.20201231192740.11075@ruby-lang.org

Issue #17496 has been updated by ufuk (Ufuk Kayserilioglu).


I also don't understand why `Math::TAU` needs to be added to Ruby, even though I am familiar with the manifesto and think it might have a merit. However, it is just a redefinition of a basic mathematical constant that doesn't bring much else to the table other than making learning some trig concepts simpler. Moreover, the manifesto explicitly states:

>**How can we switch from π to τ?**
> The next time you write something that uses the circle constant, simply say “For convenience, we set τ=2π”, and then proceed as usual.

Which means that all you have to do is:

```ruby
Math::TAU = 2 * Math::PI
```

in your codebase if you want to use it, as suggested by the manifesto. There is no need for Ruby to add all possible constants to the language, especially not the ones that are expressible in terms of constants that already exist.

Basically, it boils down to: Is there a mathematical operation you can't perform if Ruby does not define Tau? I'd say: no. Happy to hear otherwise.

----------------------------------------
Feature #17496: Add constant Math::TAU
https://bugs.ruby-lang.org/issues/17496#change-89708

* Author: jzakiya (Jabari Zakiya)
* Status: Open
* Priority: Normal
----------------------------------------
Excuse me if this has been brought up before.

This is a simple proposal to add the math constant ``Math::TAU`` = 2*``Math::PI``.

See: https://tauday.com/

``TAU`` has been included in a growing number of languages (Rust, Python3, Julia, et al), and this would add Ruby to that list, and make it even cooler. :-)



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2021-01-01 22:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 19:27 [ruby-core:101838] [Ruby master Feature#17496] Add constant Math::TAU jzakiya
2020-12-31 21:13 ` [ruby-core:101839] " merch-redmine
2020-12-31 22:16 ` [ruby-core:101841] " jzakiya
2020-12-31 22:18 ` [ruby-core:101842] " chris
2020-12-31 22:47 ` [ruby-core:101843] " jzakiya
2021-01-01  2:14 ` [ruby-core:101844] " mame
2021-01-01  2:41 ` [ruby-core:101845] " muraken
2021-01-01  6:46 ` [ruby-core:101847] " jzakiya
2021-01-01 15:46 ` [ruby-core:101858] " jzakiya
2021-01-01 15:54 ` [ruby-core:101859] " chris
2021-01-01 16:42 ` [ruby-core:101860] " jzakiya
2021-01-01 17:04 ` [ruby-core:101861] " larskanis
2021-01-01 20:58 ` [ruby-core:101862] " jzakiya
2021-01-01 21:03 ` [ruby-core:101863] " chris
2021-01-01 21:27 ` [ruby-core:101864] " jzakiya
2021-01-01 21:30 ` [ruby-core:101865] " chris
2021-01-01 21:41 ` [ruby-core:101866] " jzakiya
2021-01-01 21:42 ` [ruby-core:101867] " chris
2021-01-01 21:48 ` [ruby-core:101868] " jzakiya
2021-01-01 22:12 ` [ruby-core:101869] " merch-redmine
2021-01-01 22:14 ` [ruby-core:101870] " chris
2021-01-01 22:34 ` ufuk [this message]
2021-01-03 22:45 ` [ruby-core:101895] " jzakiya
2021-01-05  3:19 ` [ruby-core:101924] " muraken
2021-01-12  5:19 ` [ruby-core:102016] " akr
2021-01-12  5:45 ` [ruby-core:102018] " shyouhei
2021-01-12  5:56 ` [ruby-core:102020] " shyouhei
2021-01-12  6:02 ` [ruby-core:102021] " akr
2021-01-12  6:14 ` [ruby-core:102022] " akr
2021-01-12 10:10 ` [ruby-core:102029] " sawadatsuyoshi
2021-01-12 22:38 ` [ruby-core:102039] " universato
2021-01-13  5:47 ` [ruby-core:102048] " shyouhei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-89708.20210101223421.11075@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).