Alime.242 net.unix-wizards utzoo!decvax!harpo!floyd!vax135!lime!jlw Tue May 4 23:10:03 1982 RE: Caveat Hackers When I made my comment a few days ago about 10.0 times 0.1 hardly ever being 1.0, I naturally was thinking about the folly of trusting floating point roundoff. It has become clear to me through the good offices of a hacker in the woods that the compiler was really converting the floating point number to fixed point 'cvtfl' upon transferring it to the register prior to multiplying it times the fixed point number. As I see it there is some ambiguity in the C language specification. If you take Appendix A, section 6.6 as gospel, then the result is wrong. If, on the other hand, you believe Appendix A, section 7.14 as gospel, then the result is correct. The only cogent argument I heard from the mob out to get my head was that the language should provide consistent results. Therefore, I would also agree that there is a bug in the compiler. I won't even deign to comment on the person who sent me the closest binary representation of 0.1 and then expected the compiler to make a special case because 0.5 could be exactly represented in binary. Everyone who replied to me missed the point completely. Uncontrolled conversions are to be avoided in any language. This is especially true in an monster like PL/I, and I know whereof I speak. ----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen of http://communication.ucsd.edu/A-News/ This Usenet Oldnews Archive article may be copied and distributed freely, provided: 1. There is no money collected for the text(s) of the articles. 2. The following notice remains appended to each copy: The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.