3 ms·
check out https://zjkmxy.github.io/posts/2021/11/twos-complement-2-adic/ https://zjkmxy.github.io/posts/2021/11/twos-complement-2-adi... for a discussion of som
by boonsuan 4y ago
check out https://zjkmxy.github.io/posts/2021/11/twos-complement-2-adic/ https://zjkmxy.github.io/posts/2021/11/twos-complement-2-adi... for a discussion of some relevant mathematics; cool stuff
there is also a lot of good stuff concerning such computational tricks and their relation with 2-adics in section 7.1.3 (Bitwise Tricks and Techniques) of volume 4A of The Art of Computer Programming: https://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz https://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz