14 lines
187 B
Python
14 lines
187 B
Python
|
|
import struct
|
|
|
|
def float_bin(number):
|
|
return bin(struct.unpack('<I', struct.pack('<f', number))[0])
|
|
|
|
def main():
|
|
|
|
print(float_bin(5.75))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|