> Erm.. Loren.. While that may be true of binary fractions, nobody uses > binary fractions. > > In IEEE floating point format (single precision or otherwise), 0.001 has > an exact binary representation. > > Very few things in this world use binary fractions. Standard floating > point numbers on computers is one of them.
Er, sorry, no. The value of .001 in IEEE double precision (64 bit representation) is 0x3F50624DD2F1A9FC. That most certainly has more than one bit set in the mantissa. If I do the following: double val1 = .001; float val2 = .001; double val3 = val2 - val1; Then val3 has the value -4.7497451284573e-011, which is 0xbdca1cac08000000. That looks to me suspiciously like a residue from a continuing fraction represented in two different precisions. Loren