Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def float_to_dirty_hex(f):
- single_precision_rep = struct.pack('>f', f)
- single_precision_val = struct.unpack(">f", a)[0]
- double_val = struct.pack('>d', single_precision_val)
- double_hex = "0x" + double_val.hex()
- return double_hex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement