stop using deprecated nan and inf values