diff --git a/maths.hpp b/maths.hpp index 62311612..d0c5b128 100644 --- a/maths.hpp +++ b/maths.hpp @@ -198,7 +198,7 @@ template constexpr T sincn [[gnu::pure]] (T x) { - return std::sin (constants::PI * x) / (constants::PI * x); + return almost_zero (x) ? 1 : std::sin (constants::PI * x) / (constants::PI * x); } @@ -207,7 +207,7 @@ template constexpr T sincu [[gnu::pure]] (T x) { - return std::sin (x) / x; + return almost_zero (x) ? 1 : std::sin (x) / x; }