title: Checking if a Float is equivalent to an integer value in Ruby
body: <p>Say I have the following code:</p>
  
  <pre><code>x = 0.8
  y = 1.0
  </code></pre>
  
  <p>What's the best way of checking that <code>y</code> is equivalent to an <code>Integer</code>? At the moment I'm doing:</p>
  
  <pre><code>y.to_int == y
  </code></pre>
  
  <p>which works, but I feel like there should be a better way.</p>