2 ms·
The article explains how it's not cheating: you are using modulo arithmetic anyway (the dial visualisation in the article), you can pick which of the congruent
by tuukkah 3y ago
The article explains how it's not cheating: you are using modulo arithmetic anyway (the dial visualisation in the article), you can pick which of the congruent numbers is the canonical one, so you choose to pick a negative one for those whose highest bit is set.
An article from another commenter explains it more extensively and explicitly: http://www.hadjian.com/articles/20221229_twos_complement.html http://www.hadjian.com/articles/20221229_twos_complement.htm...