Last active
December 19, 2023 01:21
-
-
Save joelkim/58a72f5c56cf7fe9a28fb13b20236428 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def float2bytestr(x: float) -> str: | |
| import struct | |
| return "{0:032b}".format( | |
| int("".join([f"{i:02X}" for i in list(struct.pack("!f", float(x)))]), 16) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment