Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Mar 2003 11:25:28 +0200
From:      marius@alchemy.franken.de
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        cvs-src@freebsd.org
Subject:   Re: cvs commit: src/sys/ia64/include float.h
Message-ID:  <20030331112528.C20107@newtrinity.zeist.de>
In-Reply-To: <20030331082023.GE11307@cirb503493.alcatel.com.au>; from peterjeremy@optushome.com.au on Mon, Mar 31, 2003 at 06:20:23PM %2B1000
References:  <200303272038.h2RKcM7L096560@repoman.freebsd.org> <20030327204935.GA18134@HAL9000.homeunix.com> <20030330175646.281097ad.Alexander@Leidinger.net> <20030331082023.GE11307@cirb503493.alcatel.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030331112528.C20107>