title: How to use nan and inf in C?
body: <p>I have a numerical method that could return nan or inf if there was an error, and for testing purposed I'd like to temporarily force it to return nan or inf to ensure the situation is being handled correctly. Is there a reliable, <em>compiler-independent</em> way to create values of nan and inf in C?</p>
  
  <p>After googling for about 10 minutes I've only been able to find compiler dependent solutions.</p>