cvs commit: src/sys/ia64/include float.h

marius at marius at
Mon Mar 31 01:25:40 PST 2003

On Mon, Mar 31, 2003 at 06:20:23PM +1000, Peter Jeremy wrote:
> On Sun, Mar 30, 2003 at 05:56:46PM +0200, Alexander Leidinger wrote:
> >Attached is a test for 32 and 64 bit ieee values (edge cases).
> It's not clear exactly what this program is intended to test.
> > The *_MIN
> >values (or my test program) at least on i386 machines are wrong.
> The *_MIN values represent the greatest negative value, not the
> smallest positive value.

while all *_EPSILON, *_MIN and *_MAX values are rounded and not the
exact ones (and for FLT_* and DBL_* are probably defined in some
standard) the real point of concern are the LDBL_* values, FreeBSD
seems to have simply adopted them from NetBSD, while e.g. the Intel
compiler for Linux defines also rounded but more precise ones and
Linux itself uses exact values via gcc-extensions, e.g.:
#define LDBL_MIN (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0x0, 0x80000000, 0x1, 0x0}}).__convert_long_double_d)

i don't have it at hand right now but in the sources of stlport
are some long double-conversion-tests that cause compiler-warnings
("value does not fit in required floating-point type" when putting
a DBL_MIN in a long double or something like that) when using the
FreeBSD/NetBSD-constants for LDBL_* and compiling with icc. at least
for me it wasn't exactly clear if that's the fault of the constants
or if the tests of stlport are bogus.

More information about the cvs-src mailing list