Closed johnterickson closed 3 years ago
Thanks for reporting this issue! I'll look into it when I find some time.
The first feedback from me would be that I'd like to document this behavior a bit more. At least it should be specified that we are using one's complement to represent these integers. A welcome over the previous behavior, which was simply ignorant and broken :)
Also, I'll implement some min_value()
and max_value()
methods for these helpers as they will certainly be helpful.
Again, really thanks for reporting this, and I'll release 0.5.0 once this is ready to go.
0.5.0 is released with the fix, thanks for your contribution!
Awesome! Confirmed it works in my usage at https://github.com/johnterickson/lutcomp/commit/c29dd1ff85d0996970c172f9d9fefad5249c2ae8
Hi- thanks for making this crate! One thing that was surprising to me is that small ints that are backed by signed types are not sign extended when they are unpacked. The end result is that these integers don't round trip.
If this is something that you'd accept as a pull request, I'd be happy to submit one with the right guidance. E.g. should sign extension happen on
unpack
or onDeref
or does it need to be a new API?Cheers, John
results in: