The parameters for functions from the frexp family were the wrong way round.