Bug fix for NumTraits<T>::lowest() .

std::numeric_limits<T>::min() is the lowest *positive* normalized number
for floating point types.
This fixes the test failure for geo_alignedbox8 for me.
This commit is contained in:
Jitse Niesen 2010-07-01 01:42:31 +01:00
parent 6326f4623a
commit 7d72d4f3c7

View File

@ -84,7 +84,7 @@ template<typename T> struct GenericNumTraits
return Real(0);
}
inline static T highest() { return std::numeric_limits<T>::max(); }
inline static T lowest() { return std::numeric_limits<T>::min(); }
inline static T lowest() { return IsInteger ? std::numeric_limits<T>::min() : (-std::numeric_limits<T>::max()); }
};
template<typename T> struct NumTraits : GenericNumTraits<T>