title: Floating Point, how much can I trust less than / greater than comparisons?
body: <p>Let's say I have two floating point numbers, and I want to compare them. If one is greater than the other, the program should take one fork. If the opposite is true, it should take another path. And it should do the same thing, if the value being compared is nudged very slightly in a direction that should still make it compare true.</p>
  
  <p>It's a difficult question to phrase, so I wrote this to demonstrate it -</p>
  
  <pre><code>float a = random();
  float b = random();  // always returns a number (no infinity or NaNs)
  
  if(a &lt; b){
      if( !(a &lt; b + FLOAT_EPISILON) ) launchTheMissiles();
      buildHospitals();
  
  }else if(a &gt;= b){
      if( !(a &gt;= b - FLOAT_EPISILON) ) launchTheMissiles();
      buildOrphanages();
  
  }else{
      launchTheMissiles();  // This should never be called, in any branch
  }
  </code></pre>
  
  <p>Given this code, is <code>launchTheMissiles()</code> guaranteed to never be called?</p>