Why the following works in ruby?
<p><code>to_a</code> over a range of integers behaves differently in this case.
Upto 15 decimals, <code>include?</code> returns <code>false</code> but once it reached 16 decimals array considers the decimal digit as part of array.</p>

<blockquote>
  <p>Why?</p>
</blockquote>

<pre><code>2.2.1 :020 &gt; (1..9).to_a.include?(8.999999999999999)
 =&gt; false 
2.2.1 :021 &gt; (1..9).to_a.include?(8.9999999999999999)
 =&gt; true 
2.2.1 :022 &gt;
</code></pre>

<blockquote>
  <p>And why <strong>range only</strong> says this is true</p>
</blockquote>

<pre><code>2.2.1 :001 &gt; (1..9).include?(8.9)
 =&gt; true 
</code></pre>