Re: double with precision




post.
top-
don't
Please

Roy Gourgi wrote:
Thanks Eric,

Just out of curiosity why can't the number 1.74 be represented exactly with a double?

Because a double is represented as an integer multiplied
by an integral power (positive or negative) of two. Try to
represent one and seventy-four hundredths that way, and you'll
see the problem. (It's very much like trying to represent
eleven seventeenths in ordinary decimal notation.)

--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxx
.