sparc, ia64: Compute cos(M_PI_2l) for your 128-bit long double please.
Rich Felker
dalias@aerifal.cx
Thu Apr 11 17:44:00 GMT 2013
On Wed, Apr 10, 2013 at 11:38:50PM -0400, David Miller wrote:
> From: "Carlos O'Donell" <carlos@redhat.com>
> Date: Wed, 10 Apr 2013 16:47:26 -0400
>
> > Could you check the answer for cos(M_PI_2l) on sparc for 128-bit
> > long double?
>
> 1) printf ("%.100Le\n", (long double)(M_PI_2l/2.0L));
100 is not enough. The precision needs to be equal to at least the
number of bits in the significand, and if the exponent is negative
(not the case here), then it needs to be at least the sum of the
exponent and number of bits in the significand.
I would just use something like "%.100000g\n". The %g format discards
trailing zeros, and the huge precision will ensure you don't miss
anything.
Rich
More information about the Libc-alpha
mailing list