Skip to content

Instantly share code, notes, and snippets.

@sixthgear
Created October 17, 2011 22:26
Show Gist options
  • Select an option

  • Save sixthgear/1294037 to your computer and use it in GitHub Desktop.

Select an option

Save sixthgear/1294037 to your computer and use it in GitHub Desktop.
/*
================
Q_isnan
Don't pass doubles to this
================
*/
int Q_isnan( float x )
{
floatint_t fi;
fi.f = x;
fi.ui &= 0x7FFFFFFF;
fi.ui = 0x7F800000 - fi.ui;
return (int)( (unsigned int)fi.ui >> 31 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment