diff options
| author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2006-01-19 20:28:12 +0000 | 
|---|---|---|
| committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2006-01-19 20:28:12 +0000 | 
| commit | a8e64aa86ac8122725ed6501a31701930d472fd9 (patch) | |
| tree | eceee3ea43c9c46f873dd57cf7e2ea456c210b25 /code/qcommon | |
| parent | 921cf4c9a7aa7cc588153be59c3514dd7db27b11 (diff) | |
| download | ioquake3-aero-a8e64aa86ac8122725ed6501a31701930d472fd9.tar.gz ioquake3-aero-a8e64aa86ac8122725ed6501a31701930d472fd9.zip  | |
* Added Q_isnan for NaN tests with -ffast-math
* Fixed UT/OpenAL work around
git-svn-id: svn://svn.icculus.org/quake3/trunk@510 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
| -rw-r--r-- | code/qcommon/q_math.c | 20 | ||||
| -rw-r--r-- | code/qcommon/q_shared.h | 1 | 
2 files changed, 21 insertions, 0 deletions
diff --git a/code/qcommon/q_math.c b/code/qcommon/q_math.c index de90b8b..5ddd81f 100644 --- a/code/qcommon/q_math.c +++ b/code/qcommon/q_math.c @@ -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 ); +} diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index a9388e7..e80074d 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -557,6 +557,7 @@ void MakeNormalVectors( const vec3_t forward, vec3_t right, vec3_t up );  void MatrixMultiply(float in1[3][3], float in2[3][3], float out[3][3]);  void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);  void PerpendicularVector( vec3_t dst, const vec3_t src ); +int Q_isnan( float x );  //=============================================  | 
