Integer to double conversion

(double)temp does not work as you think it works. I'm not sure how to explain.

It does not take an integer and say that the bytes in it now represent a float; it takes the integer and says to treat it as a float.