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.1.tar.gz (4.7 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.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file numeralbase-1.1.tar.gz.

File metadata

  • Download URL: numeralbase-1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for numeralbase-1.1.tar.gz
Algorithm Hash digest
SHA256 93f7cad6c038268dda849da6f63c1af7e79ba5d181ff8a3361479d22d75fda8e
MD5 86f12ec1a4fd4c2a6ba1e77dec8f3745
BLAKE2b-256 a452bd9e984248978857bfdf4be352020ad6b8f6371b2719fb4b4e09202305ff

See more details on using hashes here.

File details

Details for the file numeralbase-1.1-py3-none-any.whl.

File metadata

  • Download URL: numeralbase-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 def8995e73ff3f5ea79ab006d864a86f91ee1c84c11b3bec76d0cf16a4f55634
MD5 12f35de0ce8dd17d81a47419c28fe34a
BLAKE2b-256 c91fe9fb05c40d6cac943da60e9e691d1cd013c65ad0aecca3faf2bac6c3e627

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