Comment on Extending That XOR Trick to Billions of RowsparentComments−nullc1ythe xor of 1 through nXOR[0...x] = (x&1^(x&2)>>1)+x*(~x&1)Of course, you don't have to do this with xor, you can do it with just addition (mod wordmax) and the well known identity attributed to gauss will support you.
Comments
XOR[0...x] = (x&1^(x&2)>>1)+x*(~x&1)
Of course, you don't have to do this with xor, you can do it with just addition (mod wordmax) and the well known identity attributed to gauss will support you.