title: Checking if float is an integer
body: <p>How can I check if a <code>float</code> variable contains an integer value? So far, I've been using:</p>
  
  <pre><code>float f = 4.5886;
  if (f-(int)f == 0)
       printf("yes\n");
  else printf("no\n");
  </code></pre>
  
  <p>But I wonder if there is a better solution, or if this one has any (or many) drawbacks.</p>