[issue39644] Add Binary module.

Ananthakrishnan report at bugs.python.org
Sun Feb 16 04:14:00 EST 2020


Ananthakrishnan <ananthakrishnan15.2001 at gmail.com> added the comment:

I think this is not present in python.
This module should contain operations that can be performed on binary numbers.
In the below examples a and b are binary numbers.

binary.add(a,b)
binary.sub(a,b)
binary.mul(a,b)
binary.div(a,b)
binary.ones_complement(a)    //returns 1's complement of a.
binary.twos_complement(a)    //returns 2's complement of a.
binary.dectobi(a)            //converts decimal "a" to binary of "a".
binary.bcd(a)                //returns bcd of a.
binary.gray(a)               //returns grey code of a.
binary.min()                 //minimizes.
binarybitodec                //converts binar "a" to decimal of "a".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39644>
_______________________________________


More information about the Python-bugs-list mailing list