Skip to main content

This is the simplest module for quick work with float - bin,oct,hex.

Project description

sys_calc

Number Conversion and IEEE 754 Representation

This project includes functions for:

  1. Converting floating-point binary numbers to decimal.
  2. Converting floating-point octal numbers to decimal.
  3. Converting floating-point hexadecimal numbers to binary.
  4. Converting floating-point numbers to hexadecimal representation in IEEE 754 format (single precision).

Usage

To use the conversion functions, simply call the respective function with the number string in the desired number system.

To convert floating-point numbers to hexadecimal representation, use float_to_hex_single(f, d), where f is the floating-point number, and d is the bias (default is 127).

Examples

binary_float_to_decimal('1101.101')
octal_float_to_decimal('17.45')
hex_to_binary('A.B')
float_to_hex_single(3.14)

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

sys_calc-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

sys_calc-0.0.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

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