This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Serious bug


On Mon, 28 Sep 1998, Richard Hadsell wrote:

> The bottom
> line for any language ought to be:
> 
> (1) If you subtract a number from itself, you get 0.

Unless using floating point.

> (2) If you compare a number with itself, you get equality.

Unless using floating point.


> (3) If you assign a number to another of the same type, you get the same
> number.

Unless using floating point.

> This has nothing to do with rounding questions.  If the processor
> architecture has problems with this, the compiler has to work around
> those problems.  If this was left out of the C++ standard, it was only
> because nobody thought it would be necessary.  It's obvious.

Not to me. I was taught NEVER to use == or != with floating point, because
they simply don't make sense. Too bad that C[++] standard allows them.

/ Kamil Iskra    AmigaOS  Linux/i386  Linux/m68k               \
| GeekGadgets m68k-amigaos GCC maintainer                      |
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
\ kamil@dwd.interkom.pl   http://student.uci.agh.edu.pl/~iskra /



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]