Skip to main content

Base conversion library (base 2 to 16) with decimal and fractional support.

Project description

base_converter

A simple and reliable Python library for converting numbers between different bases (from base 2 to base 16), including support for fractions.

##Features

  • Convert from any base (2 to 16) to decimal
  • Convert from decimal to any base (2 to 16)
  • Supports fractional numbers and negative values

Installation

pip install base-converter-pedromagno

Usage

from converter_base import convert_from_base_n_to_decimal, convert_from_decimal_to_base_n

print(convert_from_base_n_to_decimal("1A.4", 16)) # Output: 26.25
print(convert_from_decimal_to_base_n(26.25, 16)) # Output: '1A.4'

This project itself does not require any third-party libraries to use the core functionality.

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

base_converter_pedromagno-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

base_converter_pedromagno-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file base_converter_pedromagno-0.1.1.tar.gz.

File metadata

File hashes

Hashes for base_converter_pedromagno-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c7e088f45f14b92151c8962d8d2e1255c4a956e0ab3a92b1dabbceb703722e8a
MD5 2b3d5c95fb4e51aba5033a208825d774
BLAKE2b-256 744e48294a059cf856efb4e10acca9bab109da48353070905d7f61a818343ef1

See more details on using hashes here.

File details

Details for the file base_converter_pedromagno-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for base_converter_pedromagno-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d882a2f0c67cef0b33d4cc1a23c21e5747b73f8b36a234eb1cfa7fef18645692
MD5 9e598634316db673ea3f6bb70ea3ed97
BLAKE2b-256 e2af7382dade46f2b6944bf25e7d74d534a7d68480aca911e94f2c76d682f2b1

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