aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/NumTraits.h
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-07-01 01:42:31 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-07-01 01:42:31 +0100
commit7d72d4f3c7c6489246048cc6c16f0e49ef0ce657 (patch)
tree5c368578324e43154011735e6e73170d82278eb9 /Eigen/src/Core/NumTraits.h
parent6326f4623a6d632bebb7691424f7d97bc85df56c (diff)
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.
Diffstat (limited to 'Eigen/src/Core/NumTraits.h')
-rw-r--r--Eigen/src/Core/NumTraits.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h
index 70ea7ef9e..a0ffa4645 100644
--- a/Eigen/src/Core/NumTraits.h
+++ b/Eigen/src/Core/NumTraits.h
@@ -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>