title: Cast a SQL Server REAL to a FLOAT (53) without error
body: <p>When transferring data from one database schema to another I encountered a confusing error in casting a <code>REAL</code> or <code>FLOAT(24)</code> to a <code>FLOAT(53)</code>. Both databases are running SQL Server 2017 on Linux.</p>
  
  <p>For example when data such as <code>33.15</code> or <code>96.69</code> is stored in a column of type <code>REAL</code> it is extracted correctly with the following:</p>
  
  <pre><code>SELECT [Value] 
  FROM MyTable 
  </code></pre>
  
  <p>However the following introduces small errors:</p>
  
  <pre><code>SELECT CAST([Value] as FLOAT(53)) 
  FROM MyTable
  </code></pre>
  
  <p>It returns <code>33.1500015258789</code> and <code>90.6900024414062</code>.</p>
  
  <p>I understand that most numbers cannot be represented exactly by floating point numbers, but this is transferring from one a 32 bit floating point to a 64 bit floating point.</p>
  
  <p>What causes a the value to change when converting from a smaller approximate SQL Server datatype to a larger approximate datatype? Does it have to do with the required storage size being 4 bytes for a <code>real</code> or <code>float(24)</code>, but 8 bytes for a <code>float(53)</code>? </p>