Can anyone tell me how to convert a float number to 32-bit binary string and from a 32-bit binary string to a float number in python?
'bin' function in python works only for integers.
I need a single bit string as in internal representation. I do not want separate bit strings for the number before and after the decimal places joined by a decimal place in between.
EDIT: The question flagged does not explain how to convert binary string to float back.
floats are 64 bits (typically IEEE 754 binary64 format, but that's not guaranteed), not 32 bits? Are you starting with a regular Pythonfloat, or with something else (e.g., anumpy.float32object).