title: floating point error in Ruby matrix calculation
body: <p>I'm writing some code that involves finding the eigenvectors of a given matrix, and was surprised that Ruby produces some unreasonable results in simple cases.</p>
  
  <p>For example, the following matrix has an eigenvector associated with eigenvalue 1:</p>
  
  <pre><code>&gt; m = Matrix[[0r, 1/2r, 1/2r, 1/3r],
               [0r,  0r,  1/4r, 1/3r],
               [0r, 1/4r,  0r,  1/3r],
               [1r, 1/4r, 1/4r,  0r]]
  </code></pre>
  
  <p>Ruby finds the eigenvalues well enough, but the eigenvector explodes:</p>
  
  <pre><code>&gt; m.eigen.eigenvalues[2]
  =&gt; 1.0000000000000009
  
  m.eigen.eigenvectors[2]
  =&gt; Vector[5.957702309312754e+15, 5.957702309312748e+15, 5.957702309312743e+15, 5.957702309312753e+15]
  </code></pre>
  
  <p>The actual eigenvector should be (7, 4, 4, 9).</p>
  
  <p>Isn't this troubling? If Ruby can't handle tiny matrices, then how can we trust it at all? Or am I doing something wrong?</p>