Deepak Borania wrote:I think it's something to do with java's representation of floats, not sure though.
It's because (as Henry said, like most languages) it is represented in binary. It is not possible to represent 0.1 precisely, so you get that sort of result. Try representing 1 / 3 precisely in decimal, and you will see the problem.