using std::isnan instead of isnanf