소스 검색

First evaluate exact number into copy before constructing interval for seach

Former-commit-id: 5c7f1ce008e3d35f1ba4bcfa1994172289360985
Alec Jacobson 9 년 전
부모
커밋
5cf518c27a
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      include/igl/copyleft/cgal/assign_scalar.cpp

+ 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 {