title: c++ float to bool conversion
body: <p>I'm looking at some 3rd party code and am unsure exactly what one line is doing. I can't post the exact code but it's along the lines of:</p>
  
  <pre><code>bool function(float x)
  {
  float f = doCalculation(x);
  return x &gt; 0 ? f : std::numeric_limits&lt;float&gt;::infinity();
  }
  </code></pre>
  
  <p>This obviously throws a warning from the compiler about converting float->bool, but what will the actual behaviour be? How does Visual C++ convert floats to bools? At the very least I should be able to replace that nasty infinity...</p>