为什么我的结果是NaN?如果向量包含NaN,如何从向量中获取最大值
int main()
{
std::vector<float> l_column;
l_column.push_back(stof("nan"));
l_column.push_back(stof("nan"));
l_column.push_back(stof("-1"));
l_column.push_back(stof("nan"));
l_column.push_back(stof("nan"));
l_column.push_back(stof("nan"));
l_column.push_back(stof("1"));
l_column.push_back(stof("nan"));
auto mymax = *std::max_element(l_column.begin(), l_column.end());
std::cout << mymax << std::endl;
return 0;
}