Date: Sun, 30 Mar 2003 17:56:46 +0200 From: Alexander Leidinger <Alexander@Leidinger.net> To: ppc@freebsd.org, das@freebsd.org Cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/ia64/include float.h Message-ID: <20030330175646.281097ad.Alexander@Leidinger.net> In-Reply-To: <20030327204935.GA18134@HAL9000.homeunix.com> References: <200303272038.h2RKcM7L096560@repoman.freebsd.org> <20030327204935.GA18134@HAL9000.homeunix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --Multipart_Sun__30_Mar_2003_17:56:46_+0200_08c2a600 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 27 Mar 2003 12:49:35 -0800 David Schultz <das@freebsd.org> wrote: > Thus spake David Schultz <das@FreeBSD.org>: > > das 2003/03/27 12:38:22 PST > > > > FreeBSD src repository > > > > Modified files: > > sys/ia64/include float.h > > Log: > > Correct LDBL_* constants based on values from i386. > > > > Revision Changes Path > > 1.4 +9 -9 src/sys/ia64/include/float.h > > BTW, this needs to be fixed for powerpc as well. Thus far I have > been assuming powerpc uses quad format (128 bits) for long doubles > based on some documentation on developer.apple.com. It would be > nice if someone could confirm/deny that. Attached is a test for 32 and 64 bit ieee values (edge cases). The *_MIN values (or my test program) at least on i386 machines are wrong. Bye, Alexander. -- It's not a bug, it's tradition! http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7 --Multipart_Sun__30_Mar_2003_17:56:46_+0200_08c2a600 Content-Type: application/octet-stream; name="ieeeFPbounds.c" Content-Disposition: attachment; filename="ieeeFPbounds.c" Content-Transfer-Encoding: base64 LyoKICogQ29weXJpZ2h0IChjKSAyMDAyIEFsZXhhbmRlciBMZWlkaW5nZXIgPG5ldGNoaWxkQEZy ZWVCU0Qub3JnPi4gQWxsIHJpZ2h0cwogKiByZXNlcnZlZC4KICogCiAqIFJlZGlzdHJpYnV0aW9u IGFuZCB1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wp9Cg== --Multipart_Sun__30_Mar_2003_17:56:46_+0200_08c2a600--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030330175646.281097ad.Alexander>