title: Convert float to double without losing precision
body: <p>I have a primitive float and I need as a primitive double. Simply casting the float to double gives me weird extra precision. For example:</p>
  
  <pre><code>float temp = 14009.35F;
  System.out.println(Float.toString(temp)); // Prints 14009.35
  System.out.println(Double.toString((double)temp)); // Prints 14009.349609375
  </code></pre>
  
  <p>However, if instead of casting, I output the float as a string, and parse the string as a double, I get what I want:</p>
  
  <pre><code>System.out.println(Double.toString(Double.parseDouble(Float.toString(temp))));
  // Prints 14009.35
  </code></pre>
  
  <p>Is there a better way than to go to String and back?</p>