title: For what purpose does java have a float primitive type?
body: <p>Can you help me clarify the usages of the float primitive in Java?</p>
  
  <p>My understanding is that converting a float value to double and vice-versa can be problematic. I read (rather long time ago and not sure that it's actual true anymore with new JVMs) that float's performance is much worse than double's. And of course floats have less precision than double.</p>
  
  <p>I also remember that when I worked with AWT and Swing I had some problems with using float or double (like using Point2D.Float or Point2D.Double).</p>
  
  <p>So, I see only 2 advantages of float over double:</p>
  
  <ol>
  <li><p>It needs only 4 bytes while double needs 8 bytes</p></li>
  <li><p>The Java Memory Model (JMM) guarantees that assignment operation is atomic with float variables while it's not atomic with double's.</p></li>
  </ol>
  
  <p>Are there any other cases where float is better then double? Do you use float in your applications? </p>