Re: how long is double

From: Francis Glassborow (francis_at_robinton.demon.co.uk)
Date: 01/07/04


Date: 7 Jan 2004 12:54:14 -0500

In message <pan.2004.01.06.12.13.21.935578@remove.this.part.rtij.nl>,
Martijn Lievaart <m@remove.this.part.rtij.nl> writes
>On Tue, 06 Jan 2004 06:35:26 -0500, kanze wrote:
>
> > I think that this was Francis' point. According to the standard, a+b+c
> > is (a+b)+c. The compiler is free to rearrange this any way it pleases,
> > as long as the results are the same as if it had done (a+b)+c. On most
> > machines, with integer arithmetic, there is no problem. On no machine
> > that I know of, however, can the compiler legally rearrange floating
> > point, unless it absolutely knows the values involved.
> >
> > There was quite a lot of discussion about this when the C standard was
> > first being written. K&R explicitly allowed rearrangement, even when it
> > would result in different results. In the end, the C standard decided
> > not to allow this.
>
>Then this seems a place where C and C++ differ, see the answer and quote
>from the C++ standard from Ron Natalie.
>
>Anyone who can confirm this?

I do not think so, I think C++ in the non-normative note [1.9 para 15]
was attempting to make current practice explicit -- i.e. regrouping.
Clause 5 para 4 largely para-phrases 6.5 paras 1-3 of the current C
Standard (or 6.3 in the old C Standard)

I do not think we intended any extra licence in C++ other than that
granted in C.

-- 
Francis Glassborow      ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
                             or http://www.robinton.demon.co.uk
Happy Xmas, Hanukkah, Yuletide, Winter/Summer Solstice to all.
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]


Relevant Pages

  • Re: DAT playback issue- refresher course needed
    ... and the interfaces are nonstandard and do not actually ... They will usually work with most AES/EBU devices ... off of hours and hours of tapes (recorded on many different machines), ... standard digital I/O and a reliable transport. ...
    (rec.audio.pro)
  • Re: Accessing Apps through RWW
    ... It is Standard with 2 nics. ... When I setup the machines using the connect ... computer wizard I got a message stating that I am not authorized to view this ...
    (microsoft.public.windows.server.sbs)
  • Re: LSE64 in standard Forth
    ... complement machines for ages, so it's simply the same thing as with C: ... two's complement unless you are on a really exotic piece of hardware. ... But in Standard Forth it's not well defined, not because of the two's complement issue, but because of the size. ... Three of the four C implementations listed in K&R edition 1 are 8/16/32 bit machines. ...
    (comp.lang.forth)
  • Re: how long is double
    ... > machines, with integer arithmetic, there is no problem. ... > that I know of, however, can the compiler legally rearrange floating ... In the end, the C standard decided ...
    (comp.lang.cpp)
  • Re: #define BITS_PER(x) (8 * sizeof(x))
    ... People are allowed to present hypothetical machines to make a point. ... (Committee oversight is not an adequate answer; ... needs to evolve, let it evolve.) ... Put in a request for it to be added to the standard. ...
    (comp.lang.c)