Takes a decimal number(int or float) as parameter and returns its binary representation.
dec2bin(num)
Immediately converts any decimal number(int or float) to its binary form.
Parameters: num
Here are some examples of usage of the dec2bin function:
>>> from dec2bin import * >>> dec2bin(-44) '-101100'
>>> from dec2bin import dec2bin >>> dec2bin(0.375) '.011'
>>> from dec2bin import dec2bin as db >>> db(73.125) '1001001.001'
>>> db(38.47) '100110.011110000101000111101011100001010001111010111'
Download link:
Python Package IndexSource code and Windows installer:
Git HubCopyright (C) 2016 Andre Rossi Korol
GNU GPLv3 License