Python library for working with different number systems
Project description
NumeralBase
Python library for working with various numeral systems.
number = convert_base('10A', 16, 10) # Number for convert; number base; convertion to base
# '10A' -> '266'
You can convert numbers up to 176 numeric system.
number = convert_base('10A', 16, 176)
# '10A' -> '1ε'
Or use your own alphabet for the numeric system:
number = convert_base('10A', 16, 2000, '01234(...)*%$&$@w!')
Class NumeralNumber
Also, special class for non-decimal numbres:
n1 = NumeralNumber("1010", 2)
n2 = NumeralNumber("FF", 16)
Arithmetic
You can use arithmetic operations for the numbers that will be in the class.
print(n1 + n2) # 10100101 (265)
print(n2 - n1) # F5 (245)
print(n1 * n2) # 111111100110 (2550)
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
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 numeralbase-1.0.tar.gz.
File metadata
- Download URL: numeralbase-1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4742b51bbed04a01d1be427137d844b259b3ef00de0662ff27a11e299ee0872f
|
|
| MD5 |
8d691f9d7f26390346e708fb0886d752
|
|
| BLAKE2b-256 |
48f7f3a7016327b135f6650cd5fe6c0c42e2fda5dde1eefa56b7ed6a4e0e857a
|
File details
Details for the file numeralbase-1.0-py3-none-any.whl.
File metadata
- Download URL: numeralbase-1.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d0eb337926ae8bdaeb3b721db107e067bc9df6f939b384ef6ba7b4dc6191829
|
|
| MD5 |
fc4b7f6cd0f763b1d9f5de766c2936e2
|
|
| BLAKE2b-256 |
b4a0e3bc74fbfce45810fa8e5088f8dc6f686d080d78f197e434cb7f2d9a1374
|