Dan Nelson wrote:
> Since base-10 fractions can't be represented exactly by a base-2
> floating-point number, any fractional value you store will be
> imprecisely stored and will cuase rounding errors.
>
That isn't "exactly" true. If you were to add the word "always" between
can't and be, it would have been true.
There are some base 10 fractions that can't be expressed exactly in base
2, and some base 2 fractions that can't be expressed exactly in base
10. However, there are also fractions that can be stored exactly in
both base 10 and base 2, such as .5, .25, .125, .75, .625. You get the
idea. I don't remember any examples of the first two cases, and am too
lazy to figure any out, but they do exist.
--
Chris W
KE5GIX
"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm"
Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com