Some utilities for our dealings with qnans.
More...
#include <assimp/defs.h>
#include <limits>
#include <stdint.h>
Go to the source code of this file.
|
AI_FORCE_INLINE bool | is_qnan (float in) |
|
AI_FORCE_INLINE bool | is_qnan (double in) |
|
AI_FORCE_INLINE bool | is_special_float (float in) |
| check whether a float is either NaN or (+/-) INF. More...
|
|
AI_FORCE_INLINE bool | is_special_float (double in) |
| check whether a double is either NaN or (+/-) INF. More...
|
|
template<class TReal > |
AI_FORCE_INLINE bool | is_not_qnan (TReal in) |
|
AI_FORCE_INLINE ai_real | get_qnan () |
| Get a fresh qnan.
|
|
Some utilities for our dealings with qnans.
- Note
- Some loaders use qnans to mark invalid values tempoarily, also Assimp explicitly enforces undefined normals to be set to qnan. qnan utilities are available in standard libraries (C99 for example) but last time I checked compiler coverage was so bad that I decided to reinvent the wheel.
◆ is_not_qnan()
template<class TReal >
AI_FORCE_INLINE bool is_not_qnan |
( |
TReal |
in | ) |
|
Check whether a float is NOT qNaN.
- Parameters
-
◆ is_qnan() [1/2]
AI_FORCE_INLINE bool is_qnan |
( |
double |
in | ) |
|
Check whether a given double is qNaN.
- Parameters
-
◆ is_qnan() [2/2]
AI_FORCE_INLINE bool is_qnan |
( |
float |
in | ) |
|
Check whether a given float is qNaN.
- Parameters
-
◆ is_special_float() [1/2]
AI_FORCE_INLINE bool is_special_float |
( |
double |
in | ) |
|
check whether a double is either NaN or (+/-) INF.
Denorms return false, they're treated like normal values.
- Parameters
-
◆ is_special_float() [2/2]
AI_FORCE_INLINE bool is_special_float |
( |
float |
in | ) |
|
check whether a float is either NaN or (+/-) INF.
Denorms return false, they're treated like normal values.
- Parameters
-