Subject: Re: accuracy of "long double"
To: Neil Booth <neil@daikokuya.co.uk>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-toolchain
Date: 08/31/2007 00:01:52
neil@daikokuya.co.uk said:
> volatile long double z = LDBL_EPSILON;
Yes, the LDBL constants don't reflect reality that well on NetBSD.
> shouldn't it be the same as DBL_EPSILON on x86 NetBSD?
Probably yes... but also LDBL_MAX is affected, and LDBL_MANT_DIG.
This effectively constitutes an new FP type, with the mantissa
of "double" and the exponent of the x87 long double.
Unfortunately, the "gdtoa" library used by printf etc needs
some work to deal with this.
> > If yes, I don't see the point of keeping <long double>
> > different from <double>?
> Well, you do get greater exponent range. But don't ask me,
> it wasn't my decision.
Technically, the "long double" type is not worth much on i386,
at least with newer processors which speed up "double" arithmetics
by SSE2+.
There is a need however to keep the "long double" type as-is:
the ELF ABI spec.
best regards
Matthias
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in Baerbel Brumme-Bothe
Vorstand: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv.
Vorsitzender)
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------