From 110bc4d6c8c665d37da8fa7d5ab00df681f753f0 Mon Sep 17 00:00:00 2001 From: Gin890 <79114795+Gin890@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:08:27 +0000 Subject: [PATCH] AudioResampler: use std::numbers::pi for the sinc argument. The hand-rolled literal 3.1415926535897932385 rounds to the exact same double as std::numbers::pi (0x1.921fb544442d18p+1), so this is a no-op numerically and just makes the code more readable. --- .../AudioResampler/Kernels_AudioResampler_WeightTable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/Kernels/AudioResampler/Kernels_AudioResampler_WeightTable.cpp b/SerialPrograms/Source/Kernels/AudioResampler/Kernels_AudioResampler_WeightTable.cpp index f9b71e6d00..fda76a0be6 100644 --- a/SerialPrograms/Source/Kernels/AudioResampler/Kernels_AudioResampler_WeightTable.cpp +++ b/SerialPrograms/Source/Kernels/AudioResampler/Kernels_AudioResampler_WeightTable.cpp @@ -6,6 +6,7 @@ #include #include +#include #include "Common/Cpp/Containers/AlignedVector.tpp" #include "Kernels/Kernels_Alignment.h" #include "Kernels/KaiserWindow/Kernels_KaiserWindow.h" @@ -102,7 +103,7 @@ WeightTable::WeightTable( x *= downsample_scale; - double arg = 3.1415926535897932385 * x; + double arg = std::numbers::pi * x; double sinc = std::sin(arg) / arg; // cout << "sinc = " << sinc << endl;