patate issueshttps://gitlab.inria.fr/patate/patate/-/issues2019-11-13T19:45:31+01:00https://gitlab.inria.fr/patate/patate/-/issues/1Grenaille: Visual studio warning "potential divide by 0" in algebraicSphere.h2019-11-13T19:45:31+01:00Ghost UserGrenaille: Visual studio warning "potential divide by 0" in algebraicSphere.hThe `center()` function in `Grenaille::AlgebraicSphere` triggers a "potential divide by 0" warning on Visual Studio 2015
Here is the code that triggers the warning
```c++
if(isPlane())
{
//return infinity (no...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
```c++
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
```c++
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