Re: It's a bug? Re: Strange problem
- Posted by Everett Williams <rett at GVTC.COM> Mar 19, 2000
- 426 views
>>att: 4.09999999999999964473 >>b: (att-floor(att) * 10) 0.99999999999999644729 >>a: (floor(b)) 0.00000000000000000000 >>att: 5.09999999999999964473 >>b: (att-floor(att) * 10) 0.99999999999999644729 >>a: (floor(b)) 0.00000000000000000000 > >That explains why, as I was puttering with the code last night, >if I made "att" slightly larger-- say 4.11 that the conversion worked... > Irv, According to the book, we only get 16 places of accuracy from a 64 bit float. Your float routine is printing 20 places. It looks to me as if you could add something small way past any point of concern depending on the equation, such as 0.00000000001 and the equation would work. I'm still interested in those last 4 places. Where are they being manufactured from? Twenty places is approximately the capacity of an 8 byte binary integer. A 64 bit float has overhead for the exponent. Also, the number is not accurate to 16 places, but 14. Curiouser and curiouser said "Alice". The thing that matters is how to know when it is going to be a 32 bit or a 64 bit float and how to get rounding routines to work to the accuracy that is wanted for any particular mathematical situation. Everett L.(Rett) Williams rett at gvtc.com