MaelRL
6/26/2019 - 11:47 AM

SDG_patch.diff

--- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h
+++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h
@@ -130,21 +130,23 @@ public:
 
   static FT compute_sqrt(const FT& x, const Tag_false&)
   {
     return FT(  CGAL::sqrt( CGAL::to_double(x) )  );
   }
 
   static
   FT to_ft(const Sqrt_1& x)
   {
     FT sqrt_c = compute_sqrt( x.root(), FT_Has_sqrt() );
     return x.a0() + x.a1() * sqrt_c;
   }
 
   static
   FT to_ft(const Sqrt_3& x)
   {
-    FT sqrt_e = compute_sqrt( to_ft(x.e()), FT_Has_sqrt() );
-    FT sqrt_f = compute_sqrt( to_ft(x.f()), FT_Has_sqrt() );
+    FT sqrt_e = compute_sqrt( (std::max)(FT(0), to_ft(x.e())), FT_Has_sqrt() );
+    FT sqrt_f = compute_sqrt( (std::max)(FT(0), to_ft(x.f())), FT_Has_sqrt() );