Skip to content

Commit 734f9b1

Browse files
authored
Merge pull request #9 from cuviper/msrv-1.86
Add `PrimitiveFloat::next_down` and `next_up` (MSRV 1.86)
2 parents 0a166b9 + 1b9f4ac commit 734f9b1

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.85.0, # MSRV
15+
1.86.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.85.0
55+
- uses: dtolnay/rust-toolchain@1.86.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.2.1"
3+
version = "0.2.2"
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.85"
10+
rust-version = "1.86"
1111

1212
[features]
1313
default = ["std"]

RELEASES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Release 0.2.2 (2025-12-16)
2+
3+
- Updated to MSRV 1.86.
4+
- Added `PrimitiveFloat::next_down` and `next_up`.
5+
16
# Release 0.2.1 (2025-12-16)
27

38
- Doc-only, updated 0.1 references to 0.2.

src/float.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ pub trait PrimitiveFloat:
224224
/// Returns the minimum of the two numbers, ignoring NaN.
225225
fn min(self, other: Self) -> Self;
226226

227+
/// Returns the greatest number less than `self`.
228+
fn next_down(self) -> Self;
229+
230+
/// Returns the least number greater than `self`.
231+
fn next_up(self) -> Self;
232+
227233
/// Takes the reciprocal (inverse) of a number, `1/x`.
228234
fn recip(self) -> Self;
229235

@@ -523,6 +529,8 @@ macro_rules! impl_float {
523529
fn max(self, other: Self) -> Self;
524530
fn midpoint(self, other: Self) -> Self;
525531
fn min(self, other: Self) -> Self;
532+
fn next_down(self) -> Self;
533+
fn next_up(self) -> Self;
526534
fn recip(self) -> Self;
527535
fn signum(self) -> Self;
528536
fn to_bits(self) -> Self::Bits;

0 commit comments

Comments
 (0)