A double should be able to to exactly hold every possible value of a float. Casting a float to a double should not change the value, and casting back to a float should return the original value, as long as you didn't perform any calculations on the double in the meantime.