Can anyone explain why the last result in these statements is not the bit-flipped version of arr?
(Debug) In[189]:= arr = {0, 0, 1, 0, 0, 0, 1, 0}
(Debug) Out[189]= {0, 0, 1, 0, 0, 0, 1, 0}
(Debug) In[190]:= FromDigits[%, 2]
(Debug) Out[190]= 34
(Debug) In[191]:= BitNot[%]
(Debug) Out[191]= -35
(Debug) In[192]:= IntegerDigits[%, 2, 8]
(Debug) Out[192]= {0, 0, 1, 0, 0, 0, 1, 1}
BitNot[n]
is simply equivalent to-1-n
." $\endgroup$BitXor[1,array]
... $\endgroup$