def float_to_hex(f): return hex(struct.unpack('<I', struct.pack('<f', f))[0]) float_to_hex(17.5) # Output: '0x418c0000'.
確定! 回上一頁