There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Re: Still puzzled by floats
by blakem
|
|