Use FLT_MAX if possible (fix VAX)
Only test NAN's if we have them.
use DBL_MAX instead of 1.0e150...