Commit 348c2b51 authored by Guolin Ke's avatar Guolin Ke
Browse files

fix a bug in Common::AvoidInf.

parent 2e9c2be5
...@@ -465,8 +465,8 @@ inline static std::vector<int> VectorSize(const std::vector<std::vector<T>>& dat ...@@ -465,8 +465,8 @@ inline static std::vector<int> VectorSize(const std::vector<std::vector<T>>& dat
inline static double AvoidInf(double x) { inline static double AvoidInf(double x) {
if (x >= std::numeric_limits<double>::max()) { if (x >= std::numeric_limits<double>::max()) {
return std::numeric_limits<double>::max(); return std::numeric_limits<double>::max();
} else if(x <= std::numeric_limits<double>::min()) { } else if(x <= std::numeric_limits<double>::lowest()) {
return std::numeric_limits<double>::min(); return std::numeric_limits<double>::lowest();
} else { } else {
return x; return x;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment