Boost logo

Boost :

From: Moore, Paul (paul.moore_at_[hidden])
Date: 2000-11-28 09:12:33


From: d.frey_at_[hidden] [mailto:d.frey_at_[hidden]]
> BTW: A float (or double) that has a binary internal representation can
> never result in an infite decimal representation, as every bit is a
> finite number and therefore their sum is finite, too.

Oh, certainly. But an exact decimal representation can result in an infinite
binary representation, which gets truncated internally. The truncation loses
accuracy which makes converting back to the same exact decimal (or rational)
representation impossible. In practice, converting to the "simplest"
rational representation which rounds to the given binary value, seems to
"undo" the accuracy loss. But it should be clear that THIS IS NOT
INFALLIBLE. It merely reflects the fact that people in practice (prefer to)
work with simpler fractions rather than complex ones...

Paul.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk