[PATCH] Implement "P0631R4 Math Constants" for C++20

Jonathan Wakely jwakely@redhat.com
Tue Aug 6 15:59:00 GMT 2019


On 31/07/19 17:57 -0500, Segher Boessenkool wrote:
>On Wed, Jul 31, 2019 at 08:43:50PM +0200, Marc Glisse wrote:
>> On Wed, 31 Jul 2019, Jonathan Wakely wrote:
>>
>> >So something like the attached patch.  The glibc <math.h> says the
>> >values I used have enough digits for IEEE quad-precision:
>> >
>> >/* The above constants are not adequate for computation using `long
>> >double's.
>> > Therefore we provide as an extension constants with similar names as a
>> > GNU extension.  Provide enough digits for the 128-bit IEEE quad.  */
>> >
>> >I don't know if we need more accuracy for IBM double double.
>>
>> double double has less precision than quad so it should be fine.
>
>The *precision* (as defined in IEEE 754) of double double is much higher
>than that of IEEE quad precision float: "the maximum number of
>significant digits that can be represented in a format" -- it's just
>that most of those bits have to be zero!
>
>Neither double-double is a subset of QP, nor the other way around.  This
>is *the* problem we have in rs6000 with these two float formats: GCC
>cannot handle if two FP formats are like that.
>
>(The math constants here are fine for double double, of course).

Thanks. I've committed the attached patch then, after testing on
x86_64-linux and powerpc64le-linux.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 4940 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190806/e747e521/attachment.bin>


More information about the Libstdc++ mailing list