Skip to content

feat: implement CheckedNeg for Ratio#152

Open
SAY-5 wants to merge 1 commit into
rust-num:masterfrom
SAY-5:feat/checked-neg
Open

feat: implement CheckedNeg for Ratio#152
SAY-5 wants to merge 1 commit into
rust-num:masterfrom
SAY-5:feat/checked-neg

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 18, 2026

Implements CheckedNeg for Ratio<T> whenever T: CheckedNeg, so callers can negate values like Ratio::new(i64::MIN, 3) without overflow panics. As confirmed in #137, this only adds a new trait impl and existing API surface is unchanged.

Closes #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rational<T> should implement CheckedNeg whenever T does

1 participant