I tried this just now on Windows XP, with Sun
Java 1.6.0 update 6:
The output is: 4.0
You probably know that data types such as double are not infinitely precise. Do you yet 3.90... if you run that exact code? That would be strange. You could try searching the
Sun bug database if there's a known issue with regard to this on SunOS.
Do you have another computer (with maybe a different OS) on which you can
test your code?