# SPDX-License-Identifier: MIT
parse_hex = float.fromhex
print(parse_hex.__self__.__name__, parse_hex.__name__)
for spelling in ('0x1.8p+2', '-0', '1.00000000000008001', 'inf'):
    print(parse_hex(spelling).hex())
for spelling in ('1p', '1_2', '1p9999x'):
    try:
        print(parse_hex(spelling))
    except (ValueError, OverflowError) as error:
        print(type(error).__name__, str(error))
print((12.0).fromhex('a'), parse_hex(*('0x.4p1',), **{}))
