2 lines
104 B
Text
2 lines
104 B
Text
graycode[n_]:=BitXor[n,BitShiftRight[n]]
|
|
graydecode[n_]:=Fold[BitXor,0,FixedPointList[BitShiftRight,n]]
|