3 ms·
They're doing a bunch of bit voodoo. The ^ operator is XOR, '<<' shifts bits left and '&' is a bitwise AND. That's what they are in C++ at least. x = a&x ?
by uuilly 19y ago
They're doing a bunch of bit voodoo. The ^ operator is XOR, '<<' shifts bits left and '&' is a bitwise AND. That's what they are in C++ at least.
x = a&x ? a&b : c+x
is a lot like the C++ shorthand if-then-else thingamabob:
x = ( 1 < 0 ) ? 10 : -10;
which translates to:
x = 10 if 1 < 0 else x = -10.
Not sure what they mean with their thingamabob though.
- brett 19y agoTheir ternary operator is a ternary operator.