added nan and infinite