Conside the following for C# and Java,
double d = 3 / 2 * 3.2;
Java
System.out.println(d); // 3.2
C#
Console.WriteLine(d); //3.2
It skip the 3/2,
We know that the correct answer should be 4.8
if i change to
double d = 3.00 / 2 * 3.2;
I can get 4.8,
So i want to ask, if (3 / 2 * 3.2) is illegal , why eclipse and vs2008 have no error? And how to prevent this problem in both C# and Java?