Closed Bug 1032203 Opened 10 years ago Closed 9 years ago

Implement a Math.TAU constant

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: janx, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

The addition of a Math.TAU constant equating to 2*Math.PI has been proposed in this es-discuss thread: http://esdiscuss.org/topic/math-tau
Attached patch Implement a Math.TAU constant (obsolete) — Splinter Review
Proposed implementation.
Might be of interest to Dan as well, as I remember he advocated for Tau on yammer at some point.
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Comment on attachment 8447996 [details] [diff] [review]
Implement a Math.TAU constant

Review of attachment 8447996 [details] [diff] [review]:
-----------------------------------------------------------------

The patch looks good to me.

People who find the Pi Manifesto interesting may also be interested in the Tau Manifesto's response to it:

http://www.tauday.com/tau-manifesto#sec-the_pi_manifesto_a_rebuttal
Attachment #8447996 - Flags: feedback+
I will note that the Tau manifesto's rebuttal continues the habit of cherry-picking specific formulae, ignoring most of the long list in the Pi manifesto's section 7.  Further, the Tau Manifesto's section 5.1 appears to undercut it's own argument by showing that "eta" (==pi/4==tau/2) is the "true" fundamental constant for the volume of multidimensional spheres.  Are we going to add Math.ETA as well?

(Note that, due to the way IEEE floats are represented, Math.PI, Math.TAU, and Math.ETA have exactly identical precision, only differing by exponent fields +/- 1.  So there's no strictly numerical reason to add more than one circle-based constant.)
I apologize; I made a mistake in starting this discussion here. es-discuss is a more appropriate forum for this topic.
Well, if the JS runtime vendors decide to lead on this matter, this bugzilla wouldn't necessarily be inappropriate.  If the vendors decide to wait for the ES6 process, then es-discuss is indeed the proper venue.

Since I think Math.TAU is "fun" (even though I am a Pi-ist), I'm not opposed to Mozilla adding Math.TAU as a browser-specific tweak.
Attachment #8447996 - Attachment is obsolete: true
Comment on attachment 8448262 [details] [diff] [review]
Implement a Math.TAU constant.

Added missing digits and a simple test.

Try: https://tbpl.mozilla.org/?tree=Try&rev=426ae1466446

Ben, would you do me the honor?
Attachment #8448262 - Flags: review?(benj)
Note that V8's implementation is on hold until TC39 approval: https://codereview.chromium.org/358423003/
Please don't pollute the engine and specification for personal amusement. This proposal offers nothing that the trivial manual definition of |Math.TAU = 2 * Math.PI| does not, aside from browser incompatibility, which will require detection and the same equivalent, trivial fall-back anyway. It would be best to wait for TC39 approval.
Comment on attachment 8448262 [details] [diff] [review]
Implement a Math.TAU constant.

Review of attachment 8448262 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, let's wait on TC39 decision.
Attachment #8448262 - Flags: review?(benj)
TC39 rejected the proposal: https://github.com/tc39/tc39-notes/blob/master/es6/2014-07/jul-31.md#51-mathtau

Resolving as Won't Fix.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: