Re: how long is double
From: Francis Glassborow (francis_at_robinton.demon.co.uk)
Date: 01/07/04
- Next message: John Potter: "Re: how long is double"
- Previous message: Francis Glassborow: "Re: Sorting records using sort()"
- In reply to: Martijn Lievaart: "Re: how long is double"
- Next in thread: John Potter: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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! ]
- Next message: John Potter: "Re: how long is double"
- Previous message: Francis Glassborow: "Re: Sorting records using sort()"
- In reply to: Martijn Lievaart: "Re: how long is double"
- Next in thread: John Potter: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|