I am executing this single Java line:
System.out.print(5/9*(0-32));
The result I am expecting is:
-17.77
But it is instead printing 0
.
It works if I do the following casting:
System.out.print((double)5/9*(0-32));
My question is: why do I need to do this casting? Moreover, shouldn't it print 17
if it is translating that expression to an int?