Gray code is a binary numeral system where two successive numbers differ in only one bit.
This module provides an interface to encode/decode numbers
represented as lists of
Algorithm: Haupt, R.L. and Haupt, S.E., Practical Genetic Algorithms, Second ed. (2004), 5.4. Gray Codes.
Take a list of bits (most significant last) in binary encoding and convert them to Gray code.
Take a list of bits in Gray code and convert them to binary encoding (most significant bit last).
Convert a number to a list of bits in usual binary encoding (most significant last).
This function is undefined for negative numbers of types that do not
have fixed bitsize, like