From f4a2f605b8c0c30e624d49a128d45adfd8ccda31 Mon Sep 17 00:00:00 2001
From: Jiao Lin <linjiao@ornl.gov>
Date: Mon, 7 Aug 2017 16:55:48 -0400
Subject: [PATCH] Refs #20172. use <limits>. roll back V3D.h

---
 Framework/Geometry/src/Surfaces/Cylinder.cpp | 5 +++--
 Framework/Geometry/src/Surfaces/Plane.cpp    | 5 +++--
 Framework/Kernel/inc/MantidKernel/V3D.h      | 1 -
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Framework/Geometry/src/Surfaces/Cylinder.cpp b/Framework/Geometry/src/Surfaces/Cylinder.cpp
index f9c68d47e3e..ee1d6fba81e 100644
--- a/Framework/Geometry/src/Surfaces/Cylinder.cpp
+++ b/Framework/Geometry/src/Surfaces/Cylinder.cpp
@@ -2,6 +2,7 @@
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/Tolerance.h"
 #include <iostream>
+#include <limits>
 
 #ifdef ENABLE_OPENCASCADE
 // Opencascade defines _USE_MATH_DEFINES without checking whether it is already
@@ -397,8 +398,8 @@ void Cylinder::getBoundingBox(double &xmax, double &ymax, double &zmax,
     listOfPoints.push_back(zmaxPoint);
   }
   if (!listOfPoints.empty()) {
-    xmin = ymin = zmin = DBL_MAX;
-    xmax = ymax = zmax = DBL_MIN;
+    xmin = ymin = zmin = std::numeric_limits<double>::max();
+    xmax = ymax = zmax = std::numeric_limits<double>::min();
     for (std::vector<V3D>::const_iterator it = listOfPoints.begin();
          it != listOfPoints.end(); ++it) {
       //			std::cout<<(*it)<<'\n';
diff --git a/Framework/Geometry/src/Surfaces/Plane.cpp b/Framework/Geometry/src/Surfaces/Plane.cpp
index ade992ef937..5bf951c2b1b 100644
--- a/Framework/Geometry/src/Surfaces/Plane.cpp
+++ b/Framework/Geometry/src/Surfaces/Plane.cpp
@@ -3,6 +3,7 @@
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/Tolerance.h"
 #include <iostream>
+#include <limits>
 
 #ifdef ENABLE_OPENCASCADE
 // Opencascade defines _USE_MATH_DEFINES without checking whether it is already
@@ -393,8 +394,8 @@ void Plane::getBoundingBox(double &xmax, double &ymax, double &zmax,
   // now sort the vertices to find the  mins and max
   //	std::cout<<listOfPoints.size()<<'\n';
   if (!listOfPoints.empty()) {
-    xmin = ymin = zmin = DBL_MAX;
-    xmax = ymax = zmax = -DBL_MAX;
+    xmin = ymin = zmin = std::numeric_limits<double>::max();
+    xmax = ymax = zmax = -std::numeric_limits<double>::max();
     for (std::vector<V3D>::const_iterator it = listOfPoints.begin();
          it != listOfPoints.end(); ++it) {
       //			std::cout<<(*it)<<'\n';
diff --git a/Framework/Kernel/inc/MantidKernel/V3D.h b/Framework/Kernel/inc/MantidKernel/V3D.h
index 96da4c74664..36547602a3c 100644
--- a/Framework/Kernel/inc/MantidKernel/V3D.h
+++ b/Framework/Kernel/inc/MantidKernel/V3D.h
@@ -2,7 +2,6 @@
 #define MANTID_KERNEL_V3D_H_
 
 #include <cmath>
-#include <cfloat>
 #include <iosfwd>
 #include <vector>
 #include "MantidKernel/DllConfig.h"
-- 
GitLab