Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
krackers
on Nov 26, 2022
|
parent
|
context
|
favorite
| on:
Making all your integers positive with zigzag enco...
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: