Skip to main content

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


Download files

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

Source Distribution

numeralbase-1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

numeralbase-1.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

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

Hashes for numeralbase-1.0.tar.gz
Algorithm Hash digest
SHA256 4742b51bbed04a01d1be427137d844b259b3ef00de0662ff27a11e299ee0872f
MD5 8d691f9d7f26390346e708fb0886d752
BLAKE2b-256 48f7f3a7016327b135f6650cd5fe6c0c42e2fda5dde1eefa56b7ed6a4e0e857a

See more details on using hashes here.

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

Hashes for numeralbase-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0eb337926ae8bdaeb3b721db107e067bc9df6f939b384ef6ba7b4dc6191829
MD5 fc4b7f6cd0f763b1d9f5de766c2936e2
BLAKE2b-256 b4a0e3bc74fbfce45810fa8e5088f8dc6f686d080d78f197e434cb7f2d9a1374

See more details on using hashes here.

Supported by

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