pyhobdcalc: A python module for Python Hexadecimal Octal Binary Decimal Calculation.
Writing by: Eddie BrĂĽggemann
Language: python 2.7.3
Contact: Credits: Thank's to my beloved mother, my family and to the doctors.
Thank's: Thank's to gtackett
for the improved English style, grammar, and spelling correction from this file.
pyhobdcalc is a python module written in C which implement conversion and calculating functions in bases 2, 8, 10, 16.
Which python doesn't implement like signed binary, octal, hexadecimal conversion in integers.
Or signed float conversion from decimal to base 2, 8, 16 or from base 2, 8, 16 in decimal base.
And performs addition, subtraction, multiplication and division on integers and float strings using bases 2, 8, and 16 .
bintoint:
Convert a binary string given with optional the binary identifier "0b". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the converted value as an integer string.
octtoint:
Convert an octal string given with optional the octal identifier "0". The function can thread signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the converted value as an integer string.
hextoint:
Convert a hexadecimal string given with optional the hexadecimal identifier "0x". The function can thread signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the converted value as an integer string.
binfloattofloat:
Convert a binary string with optional binary identifier "0b" representing a floating-point value into a float with maximal precision from 15 digits.
And return the converted value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. octfloattofloat:
Convert an octal string with optional octal identifier "0" representing a floating-point value into a float with maximal precision from 15 digits.
And return the converted value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. hexfloattofloat:
Convert a hexadecimal string with optional hexadecimal identifier "0x" representing a floating-point value into a float with maximal precision from 15 digits.
And return the converted value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
floattobinfloat:
Convert a float given as a string into a floating-point binary string with a maximum length of 16 binary digits. The given float integer part has a maximum length of 8 bytes.
And return the floating-point binary string corresponding to the given float with the given limitations.
floattooctfloat:
Convert a float given as a string into a floating-point octal string with a maximum length of 16 octal digits. The given float integer part has a maximum length of 8 bytes.
And return the floating-point octal string corresponding to the given float with the given limitations.
floattohexfloat:
Convert a float given as a string into a floating-point hexadecimal string with a maximum length of 16 hexadecimal digits. The given float integer part has a maximum length of 8 bytes.
And return the floating-point hexadecimal string corresponding to the given float with the given limitations.
binaddbin:
Add 2 binary strings given with optional the binary identifier "0b". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the addition result as an integer string.
note: The addition result cannot overflow the same maximal and minimal range as for the given arguments values. binsubbin:
Subtract 2 binary strings given with optional the binary identifier "0b". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the subtraction result as an integer string.
note: The subtraction result cannot overflow the same maximal and minimal range as for the given arguments values. binmultbin:
Multiply 2 binary strings given with optional the binary identifier "0b". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the multiplication result as an integer string.
note: The multiplication result cannot overflow the same maximal and minimal range as for the given arguments values. bindivbin:
Divide 2 binary strings given with optional the binary identifier "0b". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the division result as an integer string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
octaddoct:
Add 2 octal strings given with optional the octal identifier "0". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the addition result as an integer string.
note: The addition result cannot overflow the same maximal and minimal range as for the given arguments values. octsuboct:
Subtract 2 octal strings given with optional the octal identifier "0". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the subtraction result as an integer string.
note: The subtraction result cannot overflow the same maximal and minimal range as for the given arguments values. octmultoct:
Multiply 2 octal strings given with optional the octal identifier "0". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the multiplication result as an integer string.
note: The multiplication result cannot overflow the same maximal and minimal range as for the given arguments values. octdivoct:
Divide 2 octal strings given with optional the octal identifier "0". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the division result as an integer string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
hexaddhex:
Add 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the addition result as an integer string.
note: The addition result cannot overflow the same maximal and minimal range as for the given arguments values. hexsubhex:
Subtract 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the subtraction result as an integer string.
note: The subtraction result cannot overflow the same maximal and minimal range as for the given arguments values. hexmulthex:
Multiply 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the multiplication result as an integer string.
note: The multiplication result cannot overflow the same maximal and minimal range as for the given arguments values. hexdivhex:
Divide 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts signed values in the C type long long int value range:
- Maximal value: 9223372036854775807.
- Minimal value: -9223372036854775808.
And return the division result as an integer string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
binfloataddbinfloat:
Add 2 binary strings given with optional the binary identifier "0b". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire binary string can contains 128 binary digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. binfloatsubbinfloat:
Subtract 2 binary strings given with optional the binary identifier "0b". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire binary string can contains 128 binary digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. binfloatmultbinfloat:
Multiply 2 binary strings given with optional the binary identifier "0b". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire binary string can contains 128 binary digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. binfloatdivbinfloat:
Divide 2 binary strings given with optional the binary identifier "0b". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire binary string can contains 128 binary digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
octfloataddoctfloat:
Add 2 octal strings given with optional the octal identifier "0". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire octal string can contains 48 octal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. octfloatsuboctfloat:
Subtract 2 octal strings given with optional the octal identifier "0". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire octal string can contains 48 octal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. octfloatmultoctfloat:
Multiply 2 octal strings given with optional the octal identifier "0". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire octal string can contains 48 octal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. octfloatdivoctfloat:
Divide 2 octal strings given with optional the octal identifier "0". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire octal string can contains 48 octal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
hexfloataddhexfloat:
Add 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire hexadecimal string can contains 16 hexadecimal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. hexfloatsubhexfloat:
Subtract 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire hexadecimal string can contains 16 hexadecimal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. hexfloatmulthexfloat:
Multiply 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire hexadecimal string can contains 16 hexadecimal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value. hexfloatdivhexfloat:
Divide 2 hexadecimal strings given with optional the hexadecimal identifier "0x". The function accepts 8 bytes values for the integer part from the float, in the C type long long int value range:
- Maximal integer part value: 9223372036854775807.
- Minimal integer part value: -9223372036854775808.
The entire hexadecimal string can contains 16 hexadecimal digits (without identifier, sign and comma.).
And return the result value as a float string.
note: The returned value is limited to the C type double (15 digits precision) but internally the module uses the C type long double (19 digits precision) for getting an exact value.
pyhobdcalc is hosted on the PyPI (Python Package Index) .
And you can install pyhobdcalc with the pip program:
$ sudo pip install pyhobdcalcOr with the python-pip module:
$ sudo python -m pip install pyhobdcalc
This programm is under copyright from the GPL GNU GENERAL PUBLIC LICENSE |