Simbody  3.7

isNaN(x) provides a reliable way to determine if x is one of the "not a number" floating point forms. More...

Functions

bool SimTK::isNaN (const negator< float > &x)
 
bool SimTK::isNaN (const negator< double > &x)
 
template<class P >
bool SimTK::isNaN (const negator< std::complex< P > > &x)
 
template<class P >
bool SimTK::isNaN (const negator< conjugate< P > > &x)
 
bool SimTK::isNaN (const float &x)
 
bool SimTK::isNaN (const double &x)
 
template<class P >
bool SimTK::isNaN (const std::complex< P > &x)
 
template<class P >
bool SimTK::isNaN (const conjugate< P > &x)
 

Detailed Description

isNaN(x) provides a reliable way to determine if x is one of the "not a number" floating point forms.

Comparing x==NaN does not work because any relational operation involving NaN always return false, even (NaN==NaN)! This routine is specialized for all SimTK scalar types:

For complex and conjugate types, isNaN() returns true if either the real or imaginary part or both are NaN.

Function Documentation

◆ isNaN() [1/8]

bool SimTK::isNaN ( const negator< float > &  x)
inline

◆ isNaN() [2/8]

bool SimTK::isNaN ( const negator< double > &  x)
inline

◆ isNaN() [3/8]

template<class P >
bool SimTK::isNaN ( const negator< std::complex< P > > &  x)
inline

◆ isNaN() [4/8]

template<class P >
bool SimTK::isNaN ( const negator< conjugate< P > > &  x)
inline

◆ isNaN() [5/8]

bool SimTK::isNaN ( const float &  x)
inline

◆ isNaN() [6/8]

bool SimTK::isNaN ( const double &  x)
inline

◆ isNaN() [7/8]

template<class P >
bool SimTK::isNaN ( const std::complex< P > &  x)
inline

◆ isNaN() [8/8]

template<class P >
bool SimTK::isNaN ( const conjugate< P > &  x)
inline