fixed treating NAN or nan as an infinite float