* Added Q_isnan for NaN tests with -ffast-math

* Fixed UT/OpenAL work around
This commit is contained in:
Tim Angus 2006-01-19 20:28:12 +00:00
parent 73e4d33d3b
commit 58c8175024
3 changed files with 27 additions and 9 deletions

View file

@ -1252,4 +1252,24 @@ void PerpendicularVector( vec3_t dst, const vec3_t src )
VectorNormalize( dst );
}
/*
================
Q_isnan
Don't pass doubles to this
================
*/
int Q_isnan( float x )
{
union
{
float f;
unsigned int i;
} t;
t.f = x;
t.i &= 0x7FFFFFFF;
t.i = 0x7F800000 - t.i;
return (int)( (unsigned int)t.i >> 31 );
}