Path Tracer
Classes | Macros | Functions
qnan.h File Reference

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.

Classes

union  _IEEESingle
 
union  _IEEEDouble
 

Functions

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.

 

Detailed Description

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.

Function Documentation

◆ is_not_qnan()

template<class TReal >
AI_FORCE_INLINE bool is_not_qnan ( TReal  in)

Check whether a float is NOT qNaN.

Parameters
inInput value

◆ is_qnan() [1/2]

AI_FORCE_INLINE bool is_qnan ( double  in)

Check whether a given double is qNaN.

Parameters
inInput value

◆ is_qnan() [2/2]

AI_FORCE_INLINE bool is_qnan ( float  in)

Check whether a given float is qNaN.

Parameters
inInput value

◆ 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
inInput value

◆ 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
inInput value