[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Meeting the Scope and Purpose of P754
On 2007-07-14 09:51:55 +0200, Florent de Dinechin wrote:
I believe it could be done in a way that would not go against the C99
standard. C99 allows the compiler to use any precision larger than the
declared one, but does not mandate to do so AFAIK (Guillaume or Vincent
will correct me on this one).
First, the double type does not necessarily correspond to the IEEE-754
double precision (unless __STDC_IEC_559__ is 1). Then the compiler may
use any precision larger than the one corresponding to the FP type
(FLT_EVAL_METHOD gives information about that). But if you use a cast
or an assignment (see 5.1.2.3#12, 6.3.1.5#2 and 6.3.1.8#2[52]), then
the value must be converted to be exactly representable in its semantic
type.
This is what the C99 standard mandates, but in practice, compilers
often generate buggy code on x86 processors (in particular under
Linux, but I recall that MS-Windows can be affected too).
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)