mirror of
https://github.com/ioquake/ioq3.git
synced 2025-05-31 09:01:54 +00:00
* Added Q_isnan for NaN tests with -ffast-math
* Fixed UT/OpenAL work around
This commit is contained in:
parent
73e4d33d3b
commit
58c8175024
3 changed files with 27 additions and 9 deletions
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue