Created
October 17, 2011 22:26
-
-
Save sixthgear/1294037 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ================ | |
| 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