floating point multiplication BUG in C (cc compiler)

Al Dunbar userAKDU at mts.ucs.UAlberta.CA
Tue Oct 23 13:47:29 AEST 1990


In article <1990Oct20.235102.15882 at kfw.COM>, dan at kfw.COM (Dan Mick) writes:
>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?
> <<<stuff deleted>>>
 
Hear, hear. Floating point precision seems to be a sticky topic
these days. When people expect 4.4 and they get 4.3999987 they
somehow think the answer is only good to one digit! The precision
of the result of a floating point calculation doesn't relate to
the number of digits of agreement, but to its numerical proximity
to the correct answer. I always thought it misleading to consider
(pardon, but my Fortran background is showing) REAL*4 (pardon,
float) to be "accurate to 6 or seven digits", as such statements
tend to propagate such "imprecise" beliefs.
 
-------------------+-------------------------------------------
Al Dunbar          |
Edmonton, Alberta  |   this space for rent
CANADA             |
-------------------+-------------------------------------------



More information about the Comp.lang.c mailing list