Skip to content

Commit 6ec758c

Browse files
kalwaltclaude
andcommitted
fix(kpm): silence clippy::excessive_precision on SMOOTH_KERNEL
CI clippy run flagged the 15-digit f32 literals in SMOOTH_KERNEL with clippy::excessive_precision, suggesting truncation to ~8 digits. We deliberately keep the full 15-digit C++ form for source-level fidelity with the port (so a reviewer can compare digit-for-digit against the C++ source without doing the rounding mentally). The literal parser handles trailing digits identically to clipping them in f32, so this is purely about source readability — no behavioral change. Add a localized #[allow(clippy::excessive_precision)] on the const with a comment documenting the rationale. refs #125 #128 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 5d0c765 commit 6ec758c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

crates/core/src/kpm/freak/orientation.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ const ONE_OVER_2PI: f32 = 1.0 / TWO_PI;
5959
/// The 15-digit literals are taken verbatim from the C++ source with the
6060
/// explicit `_f32` suffix so Rust rounds them directly to the same f32
6161
/// bit pattern as the C++ `float` literals.
62+
///
63+
/// `clippy::excessive_precision` would suggest truncating to ~8 digits
64+
/// (the limit of f32 precision). We deliberately keep the full 15-digit
65+
/// form for source-level fidelity with the C++ port — a reviewer
66+
/// cross-referencing the C++ can compare digit-for-digit without doing
67+
/// the rounding mentally. Rust's f32 literal parser handles the trailing
68+
/// digits identically to clipping them, so there is no behavioral
69+
/// difference; this is purely about source readability.
70+
#[allow(clippy::excessive_precision)]
6271
const SMOOTH_KERNEL: [f32; 3] = [
6372
0.274_068_619_061_197_f32,
6473
0.451_862_761_877_606_f32,

0 commit comments

Comments
 (0)