Эх сурвалжийг харах

First evaluate exact number into copy before constructing interval for seach

Former-commit-id: 5c7f1ce008e3d35f1ba4bcfa1994172289360985
Alec Jacobson 9 жил өмнө
parent
commit
5cf518c27a

+ 3 - 1
include/igl/copyleft/cgal/assign_scalar.cpp

@@ -15,9 +15,11 @@ IGL_INLINE void igl::copyleft::cgal::assign_scalar(
 }
 
 IGL_INLINE void igl::copyleft::cgal::assign_scalar(
-  const typename CGAL::Epeck::FT & cgal,
+  const typename CGAL::Epeck::FT & _cgal,
   double & d)
 {
+  // FORCE evaluation of the exact type otherwise interval might be huge.
+  const typename CGAL::Epeck::FT cgal = _cgal.exact();
   const auto interval = CGAL::to_interval(cgal);
   d = interval.first;
   do {