isNaN(x) provides a reliable way to determine if x is one of the "not a
number" floating point forms.
More...
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:
- float, double, long double
- std::complex<P> (P is one of the above precisions)
- SimTK::conjugate<P>
- SimTK::negator<T> (T is any of the above)
For complex and conjugate types, isNaN() returns true if either the real or imaginary part or both are NaN.
Function Documentation
bool SimTK::isNaN |
( |
const negator< float > & |
x | ) |
[inline] |
bool SimTK::isNaN |
( |
const negator< double > & |
x | ) |
[inline] |
bool SimTK::isNaN |
( |
const negator< long double > & |
x | ) |
[inline] |
template<class P >
bool SimTK::isNaN |
( |
const negator< std::complex< P > > & |
x | ) |
[inline] |
template<class P >
bool SimTK::isNaN |
( |
const negator< conjugate< P > > & |
x | ) |
[inline] |
bool SimTK::isNaN |
( |
const float & |
x | ) |
[inline] |
bool SimTK::isNaN |
( |
const double & |
x | ) |
[inline] |
bool SimTK::isNaN |
( |
const long double & |
x | ) |
[inline] |
template<class P >
bool SimTK::isNaN |
( |
const std::complex< P > & |
x | ) |
[inline] |
template<class P >
bool SimTK::isNaN |
( |
const conjugate< P > & |
x | ) |
[inline] |