- Notifications
You must be signed in to change notification settings - Fork157
Add CheckedNumOps#314
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cuviper commentedMay 3, 2024
I think it's just that You did not actually include |
I think this is the right thing to do here, but I'm not entirely sure.
cod10129 commentedMay 23, 2024
I wrote all that out about it and forgot to actually require |
Working with numerics in
num-traitsis biased towards using the standard traits, which is generally good. However, checked arithmetic is lacking a unifying trait (likeNumOps). This PR adds that.This traitshould theoretically be a supertrait of
PrimInt. However, this trait (likeNumOps: Rem), requiresCheckedRem.PrimIntdoes not currently require that, meaning that this would be abreaking change. (PrimInt: CheckedNumOpsfor a future release?)