def dec2bin(dec): if dec < 0: s = ' dec = dec * (-1) else: s = ' e = 127 dec = float(dec) r = int(str(dec).split('.')[0]) i = float('0.'+str(dec).split('.')[1]) rA = [] ': if r == 0: rA = ['] else: while r > 0: rA.append(r%2) r//=2 rA.reverse() rB =
IEEE 754-1985 was an industry standard for representing floating-point numbers in computers, officially adopted in 1985 and superseded in 2008 by IEEE 754-2008. During its 23 years, it was the most widely used format for floating-point computation. I
The float can be converted to well known single-precision IEEE 754 number, why 754? It's the standard representation of single-precision numbers, used in net transmission. Compares to send the float as text or send/receive without re-formatting/un-fo