Hacker News new | ask | show | jobs
by yarskegg 1325 days ago
I think this might be better for c/c++ though admittedly a bit more cryptic:

(x>>1) + (y>>1) + (0x01 & x & y)