Y
Hacker News
new
|
ask
|
show
|
jobs
by
emanuelev
3638 days ago
If you are referring to Morton's interleaving, then it's quite simple. You can compute the third operand's code and OR it with the others using the appropriate shift. Something like: (z << 2) | (y << 1) | x