2 ms·
Sorry, brain freeze. See https://news.ycombinator.com/item?id=23237663 https://news.ycombinator.com/item?id=23237663 The bitwise thing is correctly -c&x|(c-1)
by ncmncm 7y ago
Sorry, brain freeze. See
https://news.ycombinator.com/item?id=23237663 https://news.ycombinator.com/item?id=23237663
The bitwise thing is correctly -c&x|(c-1)&y.
- tom_mellior 7y agoOh, yes, I should have realized that -c is enough to transform from 0/1 to 0/-1. Thanks!