Re:Myths about Integer Overflow in Rust
by dllthomas on Saturday April 30, 2016 @04:00AM
(#11600855)
> If you like to emphasize the fact that it's mostly modulo a power of two (2^n), then call it two's complement.
And it's signed, and negative numbers work by, well, two's complement...
Referring to unsigned integers, modulo a power of two, as "two's compliment" is at least weird.
Referring to integers with a different encoding of negative numbers as "two's complement" would be incorrect, even if they still wrap around near a power of two.
And it's signed, and negative numbers work by, well, two's complement...
Referring to unsigned integers, modulo a power of two, as "two's compliment" is at least weird.
Referring to integers with a different encoding of negative numbers as "two's complement" would be incorrect, even if they still wrap around near a power of two.