title: Comparing doubles to double literals?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4915462/how-should-i-do-floating-point-comparison">How should I do floating point comparison?</a>  </p>
  </blockquote>
  
  
  
  <p>Is it not recommended to compare for equality a double and a double literal in C++, because I guess it is compiler dependent?</p>
  
  <p>To be more precise it is not OK to compare a double which is hard-coded (a literal in the source code) and a double which should be computed, as the last number of the resultant of the calculation can vary from one compiler to another. Is this not standardized?</p>
  
  <p>I heard this is mentioned in Knuth's TeXbook, is that right?</p>
  
  <p>If this is all true, what is the solution?</p>