mirror of https://github.com/CGAL/cgal
Fix a warning when `FT` is `int`
https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.14-Ic-63/Arrangement_on_surface_2_Examples/TestReport_Blake_Windows_MSVCPreview-Release-64bits.gz
This commit is contained in:
parent
db9204aced
commit
8634fc94e9
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <CGAL/determinant.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -284,6 +285,15 @@ line_get_pointC2(const FT &a, const FT &b, const FT &c, int i,
|
|||
{
|
||||
if (CGAL_NTS is_zero(b))
|
||||
{
|
||||
// Laurent Rineau, 2018/12/07: I had this CGAL_assume to calm
|
||||
// down a warning from MSVC 2017:
|
||||
// > include\cgal\constructions\kernel_ftc2.h(287) :
|
||||
// > warning C4723: potential divide by 0
|
||||
// The test `!boost::is_integral<FT>::value` is there to avoid
|
||||
// that `a != 0` is tested on anything but integral types, for
|
||||
// performance reasons.
|
||||
CGAL_assume(!boost::is_integral<FT>::value || a != FT(0));
|
||||
|
||||
x = -c/a;
|
||||
y = 1 - i * a;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue