In message: <[EMAIL PROTECTED]> Terry Lambert <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message