title: sybase 15.7 float to numeric rounding error
body: <p>Can anyone explain the following, which to me simply looks like a bug:</p>
  
  <pre><code>select convert(numeric(8,4), convert(float, '12.4155499999999996418864611769'))
  
  12.4156
  </code></pre>
  
  <p>Surely the answer should be 12.4155.
  To double check I created a table, MyTab, with a single sybase "float" column and inserted "12.4155499999999996418864611769".  Then using convert dumped the hex and got 0x4028D4C2F837B4A2.  This is indeed the IEEE 754 double precision representation of the string I inserted.  Then if I (as above) convert that to a numeric(8,4) it gives 12.4156.</p>
  
  <p>Is this wrong as I think it is, or am I going mad?</p>