C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Proposal to add the circle constant "tau"

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Sun, 25 Aug 2024 12:29:36 +0000
I'm very much convinced at this point that the argument for the introduction of tau is one of convenience rather than precision over 2*pi.


________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Andrey Semashev via Std-Proposals <std-proposals_at_[hidden]>
Sent: Sunday, August 25, 2024 2:10:20 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Andrey Semashev <andrey.semashev_at_[hidden]>
Subject: Re: [std-proposals] Proposal to add the circle constant "tau"

On 8/25/24 14:08, Mike Reed via Std-Proposals wrote:
> Isn't it possible for a literal constant for tau to be more accurate
> than 2x a literal constant for pi? E.g if my architecture is only
> accurate to 1dp then the literal for pi is 3.1, and 2x that is 6.2. But
> the literal constant for tau would be 6.3, which is more accurate.

You're thinking in decimal. IEEE-754 binary floating point types
representation, which is used practically by every C++ implementation,
uses powers of two for its digit places. That is, the significand is
represented by a binary mantissa, and the point placement within that
mantissa is described by exponent. Multiplying or dividing the number by
a power of two leaves the mantissa unchanged and only changes the
exponent. This means that the precision of the number remains the same.
At least, that's how an implementation is expected to behave.

https://en.wikipedia.org/wiki/IEEE_754

--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-08-25 12:29:39