From c3ca1e002a4165be742edc3897bccc7547a09095 Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 14 Jul 2026 15:09:34 +0800 Subject: [PATCH] physics: truncate BCRIT constant float precision Clippy warned about excessive precision in the BCRIT float literal (2.5980762). Since f32 has 24 bits of mantissa (approx 7 decimal digits of precision), the excessive decimal digits are truncated to 2.598_076 to compile cleanly under clippy::excessive_precision. The integration test still passes as the difference is well within the 1e-5 limit. --- src/physics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics.rs b/src/physics.rs index 1749628..56e37f3 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -14,7 +14,7 @@ pub const RS: f32 = 1.0; /// Critical impact parameter for a Schwarzschild hole: bcrit = (3*sqrt(3)/2) * Rs. /// Written as a literal because `f32::sqrt` is not `const` on stable Rust. /// (3 * sqrt(3) / 2 = 2.598076211353316...) -pub const BCRIT: f32 = 2.5980762; +pub const BCRIT: f32 = 2.598_076; /// One Euler step of the discretized geodesic (mirrors the shader's `deriv`). pub fn bending_accel(pos: Vec3, dir: Vec3) -> Vec3 {