use std::isnan/isinf under C++11