-
Notifications
You must be signed in to change notification settings - Fork 135
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
Wrapping neg is not implemented for PrimInt #10
Comments
Hmm, it's odd that AFAICS I suppose you could do manual 2's complement, |
From @gnzlbg on December 23, 2015 19:2 rust-lang/rust#30524 was just oppened, looks like an overlook. |
From @gnzlbg on December 23, 2015 19:3
Yes I could, thanks for the tip.
Could we use a |
There's no cfg for the rust version, unfortunately. |
From @briansmith on January 8, 2016 22:48 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... |
We were later forced to 1.8 (rust-num/num#257), so I think we can do this now without breaking. |
From @gnzlbg on December 23, 2015 18:40
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
).Copied from original issue: rust-num/num#146
The text was updated successfully, but these errors were encountered: