Skip to main content

Get 2' complemnt form of a integer

Project description

bin2(): get 2's complement form of an integer

The Python builtin function bin() gives the binary literal form of an integer. But Python uses 2's complement inside for integers. This module provide bin2() to produce 2's complement form of an integer.

>>> from bin2 import bin2
>>> bin2(-5)
0b1011

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

bin2-0.0.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

bin2-0.0.1-py3-none-any.whl (2.5 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