3 ms·
imo the best way to explain 2s compliment is via a diversion through 2-adic numbers. that also lets you explain the really fun trick where you can store multipl
by adgjlsfhk1 3y ago
imo the best way to explain 2s compliment is via a diversion through 2-adic numbers. that also lets you explain the really fun trick where you can store multiplicative inverses within the integers.
- nh23423fefe 3y agoI dunno if its "best" when compared to just regular old Z_(2^32)
- adgjlsfhk1 3y agoZ_(2^32) is a really good explanation for unsigned integers, but to me at least it's not a great explanation of why signed integers are the way they are.
- nh23423fefe 3y agoBut the justification is the same, congruence modulo 2^n Z_4 0 1 2 3 4 5 6 7 8 9 0 1 2 3 0 1 2 3 0 1 0 1 -2 -1 0 1 -2 -1 0 1