Return ValueError on bad input for __init__ and _float_to_hex