aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-02-24 20:17:27 -0800
committerChris Robinson <[email protected]>2021-02-24 20:17:27 -0800
commit5511bffdeb3dedd9e73f41cd873dbd448b3b153a (patch)
treed61c59c65c63bcce1ee6f22a7b02cbc8652d2a9a
parente1d62e2e77186e5603b4d58d7fa6354cd493a64b (diff)
Use a more appropriate epsilon for Sinc()
-rw-r--r--core/bsinc_tables.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/bsinc_tables.cpp b/core/bsinc_tables.cpp
index 919bc60b..cfd9a046 100644
--- a/core/bsinc_tables.cpp
+++ b/core/bsinc_tables.cpp
@@ -24,7 +24,8 @@ using uint = unsigned int;
*/
constexpr double Sinc(const double x)
{
- if(!(x > 1e-15 || x < -1e-15))
+ constexpr double epsilon{std::numeric_limits<double>::epsilon()};
+ if(!(x > epsilon || x < -epsilon))
return 1.0;
return std::sin(al::MathDefs<double>::Pi()*x) / (al::MathDefs<double>::Pi()*x);
}