Skip to content

Rational<T> should implement CheckedNeg whenever T does #137

Description

@cwitty

Negating a Rational64 such as Rational64::new(i64::MIN, 3) will overflow, and without CheckedNeg it's annoying to catch it.

(I think this shouldn't be a breaking change? Although I confess that I don't understand all the semver subtleties around traits.)

Activity

  1. cuviper commented on Feb 19, 2025

    @cuviper
    Member

    Adding a new trait impl should be fine! I think it would only be a semver issue if you added a T: CheckedNeg requirement to some existing API surface.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions