No project description provided
Project description
two_comp
A library for converting numbers to twos complement values
Example usage
>>> import two_comp
>>> two_comp.twos_8(0xff)
-1
>>> two_comp.twos_8(0xef)
-17
>>> two_comp.twos_16(0xeeee)
-4370
>>> two_comp.twos_16(0xabcd)
-21555
>>> two_comp.twos_32(0xabcdabcd)
-1412584499
>>> two_comp.twos_64(0xabcdabcdabcdabcd)
-6067004223159161907
>>> two_comp.twos_64(0xabcd)
43981
>>> two_comp.twos_8(0xf)
15
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
two_comp-0.0.1.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file two_comp-0.0.1.tar.gz.
File metadata
- Download URL: two_comp-0.0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b519fc7451ac511d291ce4a5dad9c91784a601acd8b1763c9789c03e3df10b7c
|
|
| MD5 |
c282bb98e6f64c0c05452d545764e6bf
|
|
| BLAKE2b-256 |
7536a4bc1e75e23c0f4f0e96db38d49904b9071a1aeb068bb764c522118a04d7
|
File details
Details for the file two_comp-0.0.1-py3-none-any.whl.
File metadata
- Download URL: two_comp-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cca175977a8d1ce8fc2762dabd73c2f15eb428f73b470c3b4ebb76307878c18
|
|
| MD5 |
84b4ba31cd8275764e4e62ed04d84dfa
|
|
| BLAKE2b-256 |
83db2738a781a996b6503fb7b1cdf2e6a2f12c7c36539af24ae2461d4c25a2b8
|