Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Still puzzled by floatsby blakem (Monsignor) |
on Oct 07, 2002 at 06:30 UTC ( [id://203258]=note: print w/replies, xml ) | Need Help?? |
The decimal 0.95 can be represented in base 10 as:
How would you represent that in binary? No matter how far you take that series it will *never* be exactly 0.95. The binary representation of 0.95 takes an infinite number of bits. 0.95(10) ≈ 0.1111 0011 0011 0011 0011 0011 0011(2) But those last four bits repeat forever. Its exactly like writing 1/3 in base 10: 1/3 ≈ 0.33333333333333333333333333333333(10)
-Blake
In Section
Seekers of Perl Wisdom
|
|