Re:Making all your integers positive with zigzag encoding
by krackers on Friday November 25, 2022 @08:20PM
(#33748872)
This is an amazing explanation, and immediately makes the formula `(val<<1) ^ (val>>31)` intuitive, compared to trying to interpret it as mapping x -> 2|x| - 1.
[ Parent
| on HN ]
There are no comments on this comment yet.