Re: how long is double
From: Martijn Lievaart (m_at_remove.this.part.rtij.nl)
Date: 01/07/04
- Next message: Chris Theis: "Re: Mersenne Twister -- A Revised C++ Implementation"
- Previous message: Richard Berg: "Re: Queue of function calls"
- In reply to: kanze_at_gabi-soft.fr: "Re: how long is double"
- Next in thread: Francis Glassborow: "Re: how long is double"
- Reply: Francis Glassborow: "Re: how long is double"
- Reply: John Potter: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Jan 2004 03:50:05 -0500
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?
M4
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
- Next message: Chris Theis: "Re: Mersenne Twister -- A Revised C++ Implementation"
- Previous message: Richard Berg: "Re: Queue of function calls"
- In reply to: kanze_at_gabi-soft.fr: "Re: how long is double"
- Next in thread: Francis Glassborow: "Re: how long is double"
- Reply: Francis Glassborow: "Re: how long is double"
- Reply: John Potter: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|