/cpp-gray

Gray code C++ library & articles

Primary LanguageC++MIT LicenseMIT

License

cpp-gray is an experimental two-part project around reflected binary code, generally known as Gray code. The project includes the following parts:

  • A C++14 library providing a gray_code class template, and a set of related functions to efficiently manipulate Gray codes without always having to convert them back to the usual two's complement representation. The documentation of that library can be found in the associated wiki.

  • A series of small articles about Gray codes describing the algorithms used by the library, as well as some additional algorithms and Gray code properties.