title: Matlab single to double conversion error
body: <p>Does someone know why casting <code>double()</code> on a single precision floating point number in Matlab (R2016a) changes the last digits? Here is an example:</p>
  
  <pre><code>format 'long'
  x=3.2530601; %arbitrary single precision number
  x_s=single(x);
  x_d=double(x_s);
  </code></pre>
  
  <p>If I look at the classes and values of the variables, I can see the following:
  <code>x</code> and <code>x_d</code> are doubles, <code>x_s</code> is single as expected. The values are:</p>
  
  <pre><code>x=3.253060100000000
  x_s=3.2530601
  x_d=3.253060102462769
  </code></pre>
  
  <p>Since the number <code>3.2530601</code> can be represented as a double or single precision floating point number, I don't understant why <code>x</code> and <code>x_d</code> are not the same. They are further away than <code>x+eps(x)</code>. I thought maybe Matlab tries to work out the double precision <code>x_d</code> by rational fraction approximation, but calling <code>rat(x,16)</code> does not give the same result as <code>x_d</code>. I'm clueless. Does anyone know what is happening here?</p>