diff --git a/libsrc/occ/Partition_Loop.cxx b/libsrc/occ/Partition_Loop.cxx
index 0511bfd..dac0555 100644
--- a/libsrc/occ/Partition_Loop.cxx
+++ b/libsrc/occ/Partition_Loop.cxx
@@ -31,6 +31,7 @@
 //using namespace std;
 #include <cstdio>
 #include <climits>
+#include <cmath>
 
 #include "Partition_Loop.ixx"
 
@@ -178,7 +179,7 @@ static Standard_Boolean  SelectEdge(const TopoDS_Face&    F,
       }
     }
 
-    Standard_Real anglemax = - PI;
+    Standard_Real anglemax = - M_PI;
     TopoDS_Edge   SelectedEdge;	
     for ( itl.Initialize(LE); itl.More(); itl.Next()) {
       const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
diff --git a/libsrc/occ/Partition_Loop2d.cxx b/libsrc/occ/Partition_Loop2d.cxx
index e9faf10..6c8f21c 100644
--- a/libsrc/occ/Partition_Loop2d.cxx
+++ b/libsrc/occ/Partition_Loop2d.cxx
@@ -13,6 +13,7 @@
 
 //using namespace std;
 #include <climits>
+#include <cmath>
 #include "Partition_Loop2d.ixx"
 
 #include "utilities.h"
@@ -209,7 +210,7 @@ static Standard_Boolean  SelectEdge(const BRepAdaptor_Surface& Surf,
     Cc->D1(uc, PC, CTg1);
     if (!isForward) CTg1.Reverse();
 
-    Standard_Real anglemin = 3 * PI, tolAng = 1.e-8;
+    Standard_Real anglemin = 3 * M_PI, tolAng = 1.e-8;
 
     // select an edge whose first derivative is most left of CTg1
     // ie an angle between Tg1 and CTg1 is least
@@ -233,7 +234,7 @@ static Standard_Boolean  SelectEdge(const BRepAdaptor_Surface& Surf,
       // -PI < angle < PI
       Standard_Real angle = Tg1.Angle(CTg1);
 
-      if (PI - Abs(angle) <= tolAng)
+      if (M_PI - Abs(angle) <= tolAng)
       {
         // an angle is too close to PI; assure that an angle sign really
         // reflects an edge position: +PI - an edge is worst,
