diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28aa341..ba003bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: rust: [ - 1.93.0, # MSRV + 1.94.0, # MSRV stable, beta, nightly, @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.93.0 + - uses: dtolnay/rust-toolchain@1.94.0 with: components: rustfmt - run: cargo fmt --all --check diff --git a/Cargo.toml b/Cargo.toml index 06e63bf..86df9df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "num-primitive" -version = "0.3.6" +version = "0.3.7" description = "Traits for primitive numeric types" repository = "https://github.com/rust-num/num-primitive" license = "MIT OR Apache-2.0" keywords = ["generic", "mathematics", "numerics", "primitive"] categories = ["algorithms", "science", "no-std"] edition = "2024" -rust-version = "1.93" +rust-version = "1.94" [package.metadata.release] allow-branch = ["main"] diff --git a/RELEASES.md b/RELEASES.md index 3ca1781..183a610 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,8 @@ +# Release 0.3.7 (2026-03-15) + +- Updated to MSRV 1.94. +- Added `PrimitiveFloat::{EULER_GAMMA, GOLDEN_RATIO}`. + # Release 0.3.6 (2026-01-26) - Link `const` documentation to the standard library. diff --git a/src/float.rs b/src/float.rs index 9035957..29da3a0 100644 --- a/src/float.rs +++ b/src/float.rs @@ -119,6 +119,9 @@ pub trait PrimitiveFloat: /// Euler's number (e) const E: Self; + /// The Euler-Mascheroni constant (γ) + const EULER_GAMMA: Self; + /// 1/π const FRAC_1_PI: Self; @@ -146,6 +149,9 @@ pub trait PrimitiveFloat: /// π/8 const FRAC_PI_8: Self; + /// The golden ratio (φ) + const GOLDEN_RATIO: Self; + /// ln(2) const LN_2: Self; @@ -487,6 +493,7 @@ macro_rules! impl_float { use_consts!($consts::{ E: Self, + EULER_GAMMA: Self, FRAC_1_PI: Self, FRAC_1_SQRT_2: Self, FRAC_2_PI: Self, @@ -496,6 +503,7 @@ macro_rules! impl_float { FRAC_PI_4: Self, FRAC_PI_6: Self, FRAC_PI_8: Self, + GOLDEN_RATIO: Self, LN_2: Self, LN_10: Self, LOG2_10: Self,