Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.c Subject: Re: floating point multiplication BUG in C (cc compiler) Message-ID: <1733@mts.ucs.UAlberta.CA> Date: 23 Oct 90 03:47:29 GMT References: <1348@banach.ACA.MCC.COM> <1990Oct20.235102.15882@kfw.COM> Organization: MTS Univ of Alberta Lines: 25 In article <1990Oct20.235102.15882@kfw.COM>, dan@kfw.COM (Dan Mick) writes: >In article <1348@banach.ACA.MCC.COM> mishra@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? > <<>> 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 | -------------------+-------------------------------------------