Java float precision changes when unexpectedly up-casting to double

I ran across a little gotcha today where a float value being inserted into another object container (JSONObject) was not holding the precision of the original value. The JSONObject actually takes a double not a float, and I overlooked the up-casting initially until I started unit testing. (have to love unit tests!)