Its because the conversion to binary is not even. Same as the fraction 1/3 becomes 0.33333333 when using decimal-system
The standard for floation numbers is called IEEE 754 and uses 32 bits
these 32 bits consist of the following parts
- sign = 1 bit (0 = + ,, 1 = -)
- exponent = 8 bits
- mantissa = 23 bits
You could check this out by visit
http://www.binaryconvert.com/result_float.html?decimal=048046051052
so when convert 0.34 (as an example) to binary it becomes
00111110 10101110 00010100 01111011
and when the computer converts it back the result in the decimal-fomrat is not exactly the same:
00111110 10101110 00010100 01111011
3.400000035762786865234375E-1