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

2019-08-06 Thread Jonathan Wakely
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 says the >values I used have enough digits for IEEE quad-precision: > >/* The above cons

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

2019-07-31 Thread Segher Boessenkool
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 says the > >values I used have enough digits for IEEE quad-precision: > > > >/* The above constants are not adequate for computation usi

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

2019-07-31 Thread Jonathan Wakely
On 31/07/19 21:16 +0200, Jakub Jelinek wrote: On Wed, Jul 31, 2019 at 07:58:55PM +0100, Jonathan Wakely wrote: > Perhaps add __extension__ before the literals too? Does that do anything for Q literals? I thought I'd tried it previously and decided it didn't. I'm happy to add it though. You're

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

2019-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 07:58:55PM +0100, Jonathan Wakely wrote: > > Perhaps add __extension__ before the literals too? > > Does that do anything for Q literals? I thought I'd tried it > previously and decided it didn't. I'm happy to add it though. You're right, it works well that way only in C,

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

2019-07-31 Thread Jonathan Wakely
On 31/07/19 20:50 +0200, Jakub Jelinek wrote: On Wed, Jul 31, 2019 at 07:37:03PM +0100, Jonathan Wakely wrote: On 31/07/19 19:07 +0200, Marc Glisse wrote: > On Wed, 31 Jul 2019, Jonathan Wakely wrote: > > > The values of the constants are taken from Glibc where the equivalent > > constant exists

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

2019-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 07:37:03PM +0100, Jonathan Wakely wrote: > On 31/07/19 19:07 +0200, Marc Glisse wrote: > > On Wed, 31 Jul 2019, Jonathan Wakely wrote: > > > > > The values of the constants are taken from Glibc where the equivalent > > > constant exists, or by rounding the actual constant t

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

2019-07-31 Thread Marc Glisse
On Wed, 31 Jul 2019, Jonathan Wakely wrote: So something like the attached patch. The glibc 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 sim

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

2019-07-31 Thread Jonathan Wakely
On 31/07/19 19:07 +0200, Marc Glisse wrote: On Wed, 31 Jul 2019, Jonathan Wakely wrote: The values of the constants are taken from Glibc where the equivalent constant exists, or by rounding the actual constant to the same number of digits as the Glibc constants have. How does it behave with _

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

2019-07-31 Thread Marc Glisse
On Wed, 31 Jul 2019, Jonathan Wakely wrote: The values of the constants are taken from Glibc where the equivalent constant exists, or by rounding the actual constant to the same number of digits as the Glibc constants have. How does it behave with __float128? I think that with -std=gnu++2a, it

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

2019-07-31 Thread Jonathan Wakely
The values of the constants are taken from Glibc where the equivalent constant exists, or by rounding the actual constant to the same number of digits as the Glibc constants have. P0631R4 Math Constants * include/Makefile.am: Add new header. * include/Makefile.in: Regenera