Skip to content

Commit bda1e63

Browse files
authored
Merge pull request #25 from cuviper/gamma-phi
Add 1.94's new floating-point constants
2 parents 6ea0ba5 + c18a863 commit bda1e63

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
rust: [
15-
1.93.0, # MSRV
15+
1.94.0, # MSRV
1616
stable,
1717
beta,
1818
nightly,
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
steps:
5454
- uses: actions/checkout@v4
55-
- uses: dtolnay/rust-toolchain@1.93.0
55+
- uses: dtolnay/rust-toolchain@1.94.0
5656
with:
5757
components: rustfmt
5858
- run: cargo fmt --all --check

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "num-primitive"
3-
version = "0.3.6"
3+
version = "0.3.7"
44
description = "Traits for primitive numeric types"
55
repository = "https://github.com/rust-num/num-primitive"
66
license = "MIT OR Apache-2.0"
77
keywords = ["generic", "mathematics", "numerics", "primitive"]
88
categories = ["algorithms", "science", "no-std"]
99
edition = "2024"
10-
rust-version = "1.93"
10+
rust-version = "1.94"
1111

1212
[package.metadata.release]
1313
allow-branch = ["main"]

RELEASES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Release 0.3.7 (2026-03-15)
2+
3+
- Updated to MSRV 1.94.
4+
- Added `PrimitiveFloat::{EULER_GAMMA, GOLDEN_RATIO}`.
5+
16
# Release 0.3.6 (2026-01-26)
27

38
- Link `const` documentation to the standard library.

src/float.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ pub trait PrimitiveFloat:
119119
/// Euler's number (e)
120120
const E: Self;
121121

122+
/// The Euler-Mascheroni constant (γ)
123+
const EULER_GAMMA: Self;
124+
122125
/// 1/π
123126
const FRAC_1_PI: Self;
124127

@@ -146,6 +149,9 @@ pub trait PrimitiveFloat:
146149
/// π/8
147150
const FRAC_PI_8: Self;
148151

152+
/// The golden ratio (φ)
153+
const GOLDEN_RATIO: Self;
154+
149155
/// ln(2)
150156
const LN_2: Self;
151157

@@ -487,6 +493,7 @@ macro_rules! impl_float {
487493

488494
use_consts!($consts::{
489495
E: Self,
496+
EULER_GAMMA: Self,
490497
FRAC_1_PI: Self,
491498
FRAC_1_SQRT_2: Self,
492499
FRAC_2_PI: Self,
@@ -496,6 +503,7 @@ macro_rules! impl_float {
496503
FRAC_PI_4: Self,
497504
FRAC_PI_6: Self,
498505
FRAC_PI_8: Self,
506+
GOLDEN_RATIO: Self,
499507
LN_2: Self,
500508
LN_10: Self,
501509
LOG2_10: Self,

0 commit comments

Comments
 (0)