title: MATLAB dealing with approximation-- singles to doubles
body: <p>I am pulling financial data into Matlab from SQL, where it is unfortunately stored as a 'Real' (which is an approximate data-type).</p>
  
  <p>For example, a value got loaded into SQL as "96.194" which is the correct value (this could have any number of decimals 1-5). I know in SQL it is stored as something like 96.19400024 because it is an approximation, but SQL Server somehow knows to display it as 96.194.</p>
  
  <p>When I pull it into matlab, it gets pulled in as 96.194, which is what I want. Unfortunately, it turns out it's not <em>actually</em> 96.194, as demonstrated:</p>
  
  <pre><code>&gt;&gt;price
  price =
             96.194
  
  &gt;&gt; price==96.194
  ans =
       0
  
  &gt;&gt; class(price)
  ans =
  single
  
  &gt;&gt; double(price)
  ans =
            96.1940002441406
  </code></pre>
  
  <p>So my question is, is there a way to convert a single to a double exactly as it appears as a single (i.e. truncate all the decimals which are the approximation? Note: I cannot just round it because I don't know how many decimals it's supposed to have.</p>