Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
vitiral
on May 23, 2024
|
parent
|
context
|
favorite
| on:
vu128: Efficient variable-length integers
zig-zag encoding is brilliant. Basically you can determine positive or negative based on odd/even and divide by 2 to get the value. I tried to come up with a similar encoding and never thought of this
edflsafoiewq
on May 23, 2024
|
next
[–]
It's the same as enumerating 2D points in a spiral, but restricted to 1D.
repelsteeltje
on May 23, 2024
|
prev
[–]
Yeah basically it's ones complement (or twos complement) but with the sign bit on the right, rather than the left.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: