From 7826a221c5c9d01d6e251a5cd3a78d09875c3a08 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 13 Oct 2026 04:32:48 +0200 Subject: [PATCH] jmath: satisfy clippy (fdlibm's constants and NaN idiom, verbatim) Co-Authored-By: Claude Opus 5.5 --- crates/horizon-core/src/jmath.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/horizon-core/src/jmath.rs b/crates/horizon-core/src/jmath.rs index 90bb9abfe..6d94b835b 100644 --- a/crates/horizon-core/src/jmath.rs +++ b/crates/horizon-core/src/jmath.rs @@ -124,7 +124,7 @@ fn with_hi(x: f64, high: i32) -> f64 { /// `java.lang.FdLibm` ports (`StrictMath`) of what the `libm` crate computes /// differently. -#[allow(clippy::excessive_precision)] // fdlibm's constants, verbatim. +#[allow(clippy::excessive_precision, clippy::approx_constant, clippy::eq_op)] // fdlibm's constants and NaN, verbatim. pub mod fdlibm { use super::{hi, with_hi}; @@ -337,7 +337,7 @@ pub mod fdlibm { /// HotSpot's AArch64 `Math.sin` / `Math.cos` stubs /// (`MacroAssembler::generate_dsin_dcos`): fdlibm with fused multiply-adds. /// Exposed on every architecture so they can be tested anywhere. -#[allow(clippy::excessive_precision, clippy::unreadable_literal)] // HotSpot's tables, verbatim. +#[allow(clippy::excessive_precision, clippy::approx_constant, clippy::unreadable_literal)] // HotSpot's tables, verbatim. pub mod aarch64 { use super::hi; @@ -474,7 +474,7 @@ pub mod aarch64 { } fn sin_cos(x: f64, is_cos: bool) -> f64 { - let ix = (hi(x) & 0x7fff_ffff) as i32; + let ix = hi(x) & 0x7fff_ffff; if ix < 0x3e400000 { return if is_cos { 1.0 } else { x }; }