]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
replace abs by fabs for doubles
authorPaul RASCLE <paul.rascle@edf.fr>
Mon, 20 May 2019 07:37:50 +0000 (09:37 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Mon, 20 May 2019 07:37:50 +0000 (09:37 +0200)
src/HYDROData/HYDROData_PolylineXY.cxx
src/HYDRO_tests/test_HYDROData_CalcCase.cxx

index 54c418ac975ccdaab3a25de9d4e12d983f2d7304..fb8a61ade903ac3fa4618dbb958ed4724848e3d2 100644 (file)
@@ -528,29 +528,29 @@ bool convertEdgesToSections( const TopoDS_Edge&
                     }
                   else // old section closed: check if we use first or last points...
                     {
-                      if((pmin < pmax) && ((std::abs(pmin - pfirst)> 1.e-3) && (std::abs(pmax - plast) >1.e-3))) // internal points forward
+                      if((pmin < pmax) && ((std::fabs(pmin - pfirst)> 1.e-3) && (std::fabs(pmax - plast) >1.e-3))) // internal points forward
                         forward = true;
-                      else if ((pmin > pmax) && ((std::abs(pmin - plast)> 1.e-3) && (std::abs(pmax - pfirst) >1.e-3))) // internal points reverse
+                      else if ((pmin > pmax) && ((std::fabs(pmin - plast)> 1.e-3) && (std::fabs(pmax - pfirst) >1.e-3))) // internal points reverse
                         {
                           pmin = p[1];
                           pmax = p[0];
                           forward = false;
                         }
-                      else if ((std::abs(pmin - plast) <1.e-3) && (p[2] < pmax)) // forward, replace pmin par pfirst
+                      else if ((std::fabs(pmin - plast) <1.e-3) && (p[2] < pmax)) // forward, replace pmin par pfirst
                           pmin = pfirst;
-                      else if ((std::abs(pmin - plast) <1.e-3) && (p[2] > pmax)) // reverse
+                      else if ((std::fabs(pmin - plast) <1.e-3) && (p[2] > pmax)) // reverse
                         {
                           pmin = p[1];
                           pmax = p[0];
                           forward = false;
                         }
-                      else if ((std::abs(pmax - pfirst) <1.e-3) && (p[2] < pmin)) // reverse
+                      else if ((std::fabs(pmax - pfirst) <1.e-3) && (p[2] < pmin)) // reverse
                         {
                           pmin = p[1];
                           pmax = p[0];
                           forward = false;
                         }
-                      else if ((std::abs(pmax - pfirst) <1.e-3) && (p[2] > pmin)) // forward, replace pmax par plast
+                      else if ((std::fabs(pmax - pfirst) <1.e-3) && (p[2] > pmin)) // forward, replace pmax par plast
                         pmax = plast;
                    }
                   DEBTRACE("forward: "<< forward << " pmin " << pmin <<  " pmax " << pmax);
index 4fd6a8681ae9341b9a29373e3e56561201dbce63..91141a7c19a77d5e4f0ed80f9ee68f16e8628784 100644 (file)
@@ -305,7 +305,7 @@ void test_HYDROData_CalcCase::test_complete_2()
     Handle(HYDROData_Object) aNewZone1c = Handle(HYDROData_Object)::DownCast( aNewZone1 );
     BRepGProp::SurfaceProperties(aNewZone1c->GetTopShape(), G1);
 
-    double diff = abs(G1.Mass()-m); //there is still a difference after calling of general fuse on complicated cases
+    double diff = fabs(G1.Mass()-m); //there is still a difference after calling of general fuse on complicated cases
     CPPUNIT_ASSERT(diff < 20.0);
     CPPUNIT_ASSERT_DOUBLES_EQUAL(23387.2, G1.Mass(), 0.1);
     CPPUNIT_ASSERT_DOUBLES_EQUAL(23370.1, m, 0.1);