diff --git a/Cargo.toml b/Cargo.toml index a696632b..35236a8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "ndarray" version = "0.17.2" edition = "2021" -rust-version = "1.64" +rust-version = "1.94" authors = [ "Ulrik Sverdrup \"bluss\"", "Jim Turner" diff --git a/src/hpc/compression_curves.rs b/src/hpc/compression_curves.rs index 517577fb..8dbaf745 100644 --- a/src/hpc/compression_curves.rs +++ b/src/hpc/compression_curves.rs @@ -257,7 +257,7 @@ impl ProductQuantizer { // Method 5: SPO Bundle (our method) // ============================================================================ -const PHI: f64 = 1.618_033_988_749_895; +const PHI: f64 = std::f64::consts::GOLDEN_RATIO; const fn golden_shift(d: usize) -> usize { let raw = (d as f64 / (PHI * PHI)) as usize; diff --git a/src/hpc/spo_bundle.rs b/src/hpc/spo_bundle.rs index f434455d..59a46e42 100644 --- a/src/hpc/spo_bundle.rs +++ b/src/hpc/spo_bundle.rs @@ -11,8 +11,8 @@ // Constants // ============================================================================ -/// Golden ratio φ ≈ 1.618033988749895 -const PHI: f64 = 1.618_033_988_749_895; +/// Golden ratio φ — Rust 1.94 stdlib constant. +const PHI: f64 = std::f64::consts::GOLDEN_RATIO; /// Compute golden shift for dimension d, ensuring odd (gcd=1 with power-of-2 d). /// floor(d / φ²), rounded to nearest odd. diff --git a/src/hpc/surround_metadata.rs b/src/hpc/surround_metadata.rs index 5d34d43e..b4ddceda 100644 --- a/src/hpc/surround_metadata.rs +++ b/src/hpc/surround_metadata.rs @@ -17,8 +17,8 @@ use super::fingerprint::Fingerprint; /// Golden angle in radians: 2π / φ² ≈ 2.39996... const GOLDEN_ANGLE: f64 = 2.399_963_229_728_653; -/// Euler-Mascheroni constant γ ≈ 0.5772... -const EULER_GAMMA: f64 = 0.577_215_664_901_532_9; +/// Euler-Mascheroni constant γ — Rust 1.94 stdlib constant. +const EULER_GAMMA: f64 = std::f64::consts::EULER_GAMMA; /// Bundle dimensionality: 8192 f64 values (must be even for Givens pairs) const D: usize = 8192; diff --git a/src/hpc/vml.rs b/src/hpc/vml.rs index fee79169..63a4bf08 100644 --- a/src/hpc/vml.rs +++ b/src/hpc/vml.rs @@ -466,9 +466,7 @@ mod tests { fn test_f64_golden_step_hydration_cost() { use std::f64::consts; // Rust 1.94: std::f64::consts::PHI and GAMMA are stable. - // On 1.93: define manually. - #[allow(dead_code)] - const PHI: f64 = 1.618033988749894848204586834365638118; + const PHI: f64 = std::f64::consts::GOLDEN_RATIO; // Simulate: 4096D f64 vector → Base17-style projection → hydration back let d = 4096usize;