diff --git a/dlib/optimization/optimization_trust_region.h b/dlib/optimization/optimization_trust_region.h index ff35ca49a..5b2fd4bd2 100644 --- a/dlib/optimization/optimization_trust_region.h +++ b/dlib/optimization/optimization_trust_region.h @@ -282,7 +282,7 @@ namespace dlib // something has gone horribly wrong if the radius has shrunk to zero. So just // give up if that happens. - if (static_cast(radius) == 0) + if (static_cast(radius) <= std::numeric_limits::min()) break; } else