No, it's not 3.999999999999999; it's
0.3999999999999999, which is as near to 0.4 as precision will allow. The problem is that 0.3999999999999999 does not allow the division to happen "one more time" and produce 0.0 as the remainder. If it could have calculated exactly then it would have got 0.0. Expect these weird results with floating point arithmetic.
I would expect that
SCJP will be limited to integer arithmetic for this operation.