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 .

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.0.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.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for base_converter_pedromagno-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f36a02a014b9559a1aed6ae892b501d5a4a1c3b071ce19e69870632cfc2f139d
MD5 67b9211c41af9602e71bc824b410bac2
BLAKE2b-256 ae12ffbdc10b67d5e9d47ae58c133b0aefba14eacac61f76b9f0bda9416b0ac9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for base_converter_pedromagno-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b488bbfb0d786fc01820356cf01e510224a9287adfb0018007c180c64cdfce92
MD5 e1a7536acd1aaf6e43984153de75f06c
BLAKE2b-256 fe5d8ab7827c4d35e2cde46631cbaca634f15263dfbcbb5aca6bdc2313e56cdc

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