Kullai,
Have you ever tried to find out why this is happening?
The reason behind this is very interesting one.
One of the reasons floating point numbers can be tricky is due to non-
obvious differences between binary and decimal (base 10) numbers. In
normal decimal numbers, the fraction 1/3rd is the infinite decimal
sequence: 0.333333333… Similarly, consider the fraction 1/10. In
decimal, this is easy represented as 0.1, and we are used to thinking
of 0.1 as an easily representable number. However, in binary, 0.1 is
represented by the infinite sequence: 0.00011001100110011…
Any way, thanks for the post. This is really help full for a
programmer.
Thank You,
Sreekar Masani