Grenaille: Visual studio warning "potential divide by 0" in algebraicSphere.h
The center()
function in Grenaille::AlgebraicSphere
triggers a "potential divide by 0" warning on Visual Studio 2015
Here is the code that triggers the warning
if(isPlane())
{
//return infinity (non-sense value)
Scalar inf = 0.;
return VectorType::Constant(Scalar(1.)/inf);
}
I suggest replacing it with the more correct version
if(isPlane())
{
//return infinity (non-sense value)
return VectorType::Constant(std::numeric_limits<Scalar>::infinity());
}
Although it might be necessary to split the code paths for cudacc like in the radius()
function above