Fix RT#85775 (inf and nan portability problems).