-
Notifications
You must be signed in to change notification settings - Fork 192
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
Enhancements for parity with primitives #140
Comments
Additionally, none of the |
Note, those traits are one and the same, defined in What would you want this to do with leading zeros? For a fixed-width size, that's no problem, just make them all ones, but Another option is to ignore leading zeros and just flip up to the most-significant bit, but that means the round trip
It does implement the trait
This doesn't fit the subject of "parity with primitives"... I have thought about adding capacity methods, sort of related to #98. I would want this to be either in bits or bytes though, not exposing the internal digit size. |
Sorry it took me so long to respond, I've been busy.
I honestly didn't think this would have been as complex of a task as it turned out to be, but (forgive me if this is just plain stupid) couldn't iterating over the internal digits and applying for digit in self.data.iter_mut() {
*digit = !*digit;
}
I'm sorry, I didn't see those!
Forgive me, I was trying to make a title that fit the more general scope of the issue
However it's exposed is fine, as long as there's a way to pre-allocate another Thank you for taking the time to respond! |
In the current We also don't keep any leading zeros, so For the round-trip problem, take a concrete example like |
For parity with primitives and other standard types, the following features would be amazing
core::ops::Not
andstd::ops::Not
forBigUint
BigUint
, e.g.checked_add
BigInt
/BigUint
with_capacity
plus a method to determine the current int's capacityThe text was updated successfully, but these errors were encountered: