Fix bug #859: pexp(NaN) returned Inf instead of NaN

This commit is contained in:
Gael Guennebaud
2014-10-20 11:38:51 +02:00
parent a72eabec9b
commit 00ec1629ca
4 changed files with 27 additions and 6 deletions

View File

@@ -406,6 +406,26 @@ void randomPermutationVector(PermutationVectorType& v, typename PermutationVecto
}
}
template<typename T> bool isNotNaN(const T& x)
{
return x==x;
}
template<typename T> bool isNaN(const T& x)
{
return x!=x;
}
template<typename T> bool isInf(const T& x)
{
return x > NumTraits<T>::highest();
}
template<typename T> bool isMinusInf(const T& x)
{
return x < NumTraits<T>::lowest();
}
} // end namespace Eigen
template<typename T> struct GetDifferentType;