Repository navigation
AudioResampler: use std::numbers::pi instead of hand-rolled pi literal - #1557
Merged
Merged
Conversation
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.
Mysticial
approved these changes
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the hand-rolled literal
3.1415926535897932385inKernels_AudioResampler_WeightTable.cppwithstd::numbers::pi(project is C++23).No numerical change: the literal and
std::numbers::piround to the exact same double (0x1.921fb544442d18p+1), so the generated weight tables are bit-identical. This is purely a readability improvement.Verified with a
g++ -std=c++23 -fsyntax-onlycompile of the translation unit.