▲ | st0le 2 days ago | |||||||
Another fun trick I've discovered. `XOR[0...n] = 0 ^ 1 .... ^ n = [n, 1, n + 1, 0][n % 4]` | ||||||||
▲ | nullc 2 days ago | parent | next [-] | |||||||
Tables yuck :P, maybe XOR[0...x] = (x&1^(x&2)>>1)+x*(~x&1) | ||||||||
| ||||||||
▲ | tialaramex 2 days ago | parent | prev [-] | |||||||
Right, or in summary, no you don't need to all that extra work up front. |