Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CheckedNumOps #314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add CheckedNumOps #314

wants to merge 1 commit into from

Conversation

cod10129
Copy link

Working with numerics in num-traits is biased towards using the standard traits, which is generally good. However, checked arithmetic is lacking a unifying trait (like NumOps). This PR adds that.
This trait should theoretically be a supertrait of PrimInt. However, this trait (like NumOps: Rem), requires CheckedRem. PrimInt does not currently require that, meaning that this would be a breaking change. (PrimInt: CheckedNumOps for a future release?)

@cuviper
Copy link
Member

cuviper commented May 3, 2024

This trait should theoretically be a supertrait of PrimInt. However, this trait (like NumOps: Rem), requires CheckedRem. PrimInt does not currently require that, meaning that this would be a breaking change. (PrimInt: CheckedNumOps for a future release?)

I think it's just that CheckedRem didn't exist at the time. Yes, it would make sense, but also yes, it would be a breaking change.

You did not actually include CheckedNumOps: CheckedRem though -- did you mean to?

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.

None yet

2 participants