Skip to content

Commit

Permalink
Compare float-pointing value to zero using <= operator (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
mloskot committed Jul 16, 2019
1 parent 73314b1 commit b1a382c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/boost/gil/image_processing/numeric.hpp
Expand Up @@ -38,7 +38,8 @@ inline double normalized_sinc(double x)
/// otherwise: normalized_sinc(x) / normalized_sinc(x / a)
inline double lanczos(double x, std::ptrdiff_t a)
{
if (x == 0)
// means == but <= avoids compiler warning
if (0 <= x && x <= 0)
return 1;

if (-a < x && x < a)
Expand Down

0 comments on commit b1a382c

Please sign in to comment.