Re:Making all your integers positive with zigzag encoding
by 10000truths on Friday November 25, 2022 @10:07PM
(#33749498)
In other words, a left rotation by 1 bit.
[ Parent
| on HN ]
Re:Making all your integers positive with zigzag encoding
by pifm_guy on Saturday November 26, 2022 @02:29AM
(#33750672)
No. From the typical 2's compliment number encoding used on all modern computers, it is not a simple rotation.
Think about the encoding of minus 1 for an example that differs...
Re:Making all your integers positive with zigzag encoding
by 10000truths on Sunday November 27, 2022 @02:50PM
(#33766087)
Argh, you're right. Classic mistake of tunnel-visioning on a subset of the domain.