Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Changing the default i387 precision

On Sat, 4 May 2013 08:50:29 -0400
Greg Troxel <gdt%ir.bbn.com@localhost> wrote:
>    long double variables get the 80-bit precision
> without
>    making (non-long) doubles get results that don't comply with
> IEEE754 (by using extended precision intermedate values)

Here is a little test program which still fails on Linux/x86_64
(gcc 4.6.3) if compiled with -mfpmath=387 -O2.
So it is still the sad fact that you can't have full "long double"
support without compromising "double" accuracy. At least with gcc.
Would be interesting to see how clang does.

best regards
#include <stdio.h>

#define FPTYPE double

test(FPTYPE x, FPTYPE y)
        const FPTYPE y2 = x + 1.0;
        if (y != y2)

        const FPTYPE x = .012;
        const FPTYPE y = x + 1.0;

        test(x, y);
        return 0;

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index