Skip to main content

Convert two's complement integer to gray code and vice versa

Project description

# Gray codes for Python

## Introduction

Library functions to convert gray code to two’s complement integer and vice versa in Python 3.

See LICENSE.md for copyright information. This library is licensed under the MIT license.

See https://en.wikipedia.org/wiki/Gray_code for details about gray codes.

## Example

import graycode

graycode.tc_to_gray_code(2) # => 3 graycode.gray_code_to_tc(3) # => 2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graycode-1.0.3.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

graycode-1.0.3-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page