title: Detecting precision loss when converting from double to float
body: <p>I am writing a piece of code in which i have to convert from double to float values. I am using boost::numeric_cast to do this conversion which will alert me of any overflow/underflow. However i am also interested in knowing if that conversion resulted in some precision loss or not. </p>
  
  <p>For example</p>
  
  <pre><code>    double source =  1988.1012;
      float dest = numeric_cast&lt;float&gt;(source);
  </code></pre>
  
  <p>Produces dest which has value 1988.1</p>
  
  <p>Is there any way available in which i can detect this kind of precision loss/rounding</p>