This is the mail archive of the
mailing list for the GCC project.
Re: (a <= 0.5) and (a > 0.5) both fail with intervening output
- To: J dot H dot B dot Nijhof at aston dot ac dot uk
- Subject: Re: (a <= 0.5) and (a > 0.5) both fail with intervening output
- From: craig at jcb-sc dot com
- Date: 7 May 1999 13:25:41 -0000
- Cc: egcs-bugs at cygnus dot com
- Cc: craig at jcb-sc dot com
- References: <199905062142.WAA15738@tux.aston.ac.uk>
>I don't know whether this classifies as a bug or as 'the usual trouble
>with floating point numbers'; in any case, it was a nasty surprise to me.
It's "the usual trouble", I'm afraid. There have been proposals made
to eliminate this particular sort of trouble in egcs/gcc, but they've
been shouted down (last December) due to worries about performance.
The egcs mailing-list archives contain most/all of the discussion,
if you're interested.
So, for now, you're expected to code around the problem. Use of
`volatile' is one way.
For a bit more discussion of the problem, see the node "Floating-point
Errors" in the g77 documentation. It contains some references to
other docs, near the end of that node.
tq vm, (burley)