-
Notifications
You must be signed in to change notification settings - Fork 149
Wrapping neg is not implemented for PrimInt #146
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
Comments
Hmm, it's odd that AFAICS I suppose you could do manual 2's complement, |
rust-lang/rust#30524 was just oppened, looks like an overlook. |
Yes I could, thanks for the tip.
Could we use a |
There's no cfg for the rust version, unfortunately. |
In the interim, you could add a new, off-by-default feature for |
That's possible, if there's strong demand. I don't want a combinatorial explosion of features though... |
This issue was moved to rust-num/num-traits#10 |
When constraining on
PrimInt
there is no way of performing wrapping neg in a generic way.The "generic" way to do this seems to be to call the
.wrapping_neg()
method which is offered by all primitive integers (but not byPrimInt
).The text was updated successfully, but these errors were encountered: