floating point multiplication BUG in C (cc compiler)

Dan Mick dan at kfw.COM
Sun Oct 21 09:51:02 AEST 1990


In article <1348 at banach.ACA.MCC.COM> mishra at banach.ACA.MCC.COM (Aditya Mishra) writes:
>BUG !!!   BUG !!!   BUG !!!
>
>THIS PROGRAM DEMONSTRATES WHAT I BELIEVE IS A BUG IN FLOATING POINT
>MULTIPLICATION IN 'C' !! 

Just out of curiosity:  Why do you think this is a problem with C?

Did it ever occur to you that it might be a problem with floating point 
on the machine?  Did you try it in Pascal, or assembly, or FORTRAN, or
as a thought experiment?

True, the problems with floating-point math on computers *do* take some time
and experience to find, if you've only done string and integer programs before,
but have you never tried to add 0.99 and 0.01 on any machine, in any language,
before?

It's not C's fault.

And, by the way:  Do you know why it's against the law to yell "FIRE!" in
a crowded theater?



More information about the Comp.lang.c mailing list