Hi Sapna,
JLS states " Instead, the
Java programming language defines % on floating-point operations to behave in a manner analogous to that of the integer remainder operator; this may be compared with the C library function fmod. "
So the computation works like a integer modulo operation. For your example: 2.2d is treated as a 2, so the remainder is 2....
Cause its a double you have a "incorrect" value, when displaying it...
hope that helps,
correct me if i'm wrong
Oliver