The secret life of NaN
Incidentally, I found a cool way of checking whether NaN occurred:<p>Just do:<p>void some_function(float number)
{
  if(number != number)
    number was passed in as &lt;NaN&gt;
}<p>Took me a little bit to get my head around it but if the number is not equal to the number, then a problem occurred. I used this to stop camera code (driven by floats) from crashing when receiving non-sense input coordinates. It still doesn&#x27;t work properly, but it doesn&#x27;t crash now either! (at least not for that :)