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:
- Converting floating-point binary numbers to decimal.
- Converting floating-point octal numbers to decimal.
- Converting floating-point hexadecimal numbers to binary.
- 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
Release history Release notifications | RSS feed
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)