From owner-freebsd-current Thu Oct 31 0:34:54 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBC9C37B401 for ; Thu, 31 Oct 2002 00:34:52 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 883A543E7B for ; Thu, 31 Oct 2002 00:34:48 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9V8YYpk051313; Thu, 31 Oct 2002 01:34:35 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 31 Oct 2002 01:33:38 -0700 (MST) Message-Id: <20021031.013338.106483974.imp@bsdimp.com> To: tlambert2@mindspring.com Cc: bde@zeta.org.au, rittle@labs.mot.com, rittle@latour.rsch.comm.mot.com, current@FreeBSD.ORG, dschultz@uclink.Berkeley.EDU Subject: Re: Lack of real long double support From: "M. Warner Losh" In-Reply-To: <3DC0E0A7.290A57CA@mindspring.com> References: <3DC0D732.C29B956C@mindspring.com> <20021031.001532.99559440.imp@bsdimp.com> <3DC0E0A7.290A57CA@mindspring.com> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <3DC0E0A7.290A57CA@mindspring.com> Terry Lambert writes: : "M. Warner Losh" wrote: : > : > This : > : > example shows that we don't support it in printf, since the above : > : > example does ***NOT*** give +Inf, but rather whatever 2*DBL_MAX is. : : [ ... ] : : > Terry you are wrong. This has to do with the RANGE not the PRECISION : > of the floating point number. It is ***NOT*** +Inf. : : I await an explanation of how you can fit 2*DBL_MAX into a double, : which has a range of DBL_MIN..DBL_MAX. Look at the code. long double a = DBL_MAX; long double b = DBL_MAX * 2; The original posting said that b would be +Inf at this point, which is not correct. I think that Bruce was confused there. The more correct example to look at was the one that rittle@ posted which was 1 + LDBL_EPSILON. : > : The main issue that I think is outstanding is that you can't get : > : both exception behaviour and non-exception behaviour, and it is : > : going to have to be the compiler's job to force the issue, because : > : it can't dictate implementaiton to the host OS. : > : > I don't follow. : : I think that a number that's a 64 bit mantissa reaised to an exponent : N takes a larger N if you have only 53 bits of mantissa, if you want : to represent the same value. Nope. The only difference between 53 bits and 64 bits of precision is just that: precision. The number of bits for expoentent is independent of this. : The obvious example in the FreeBSD case is the default value of the : expression (fpgetprec() == FP_PE). The compiler is not permitted to : assume, one way or the other; it has to do runtime testing, at the : time you compile the compiler, to comply with a completely strict : interpretation of C99 (IMO). This is true. Granting, for the moment, that fpgetprec() == FP_PE isn't a standards conforming expression. But I think that the rest of this is going off into the weeds. I'm just trying to get things working in a sane way for long doubles. It looks like gcc 3.2 really wants the fpu to start off in FP_PE. Before I go forward on this further, I've got a lot of testing to do with kernels and such to find out what really works and what does (and doesn't) break paranoia.c. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message