Changed isnan() to std::isnan()

The isnan() function appears to be living in name space 'std' in the newer versions of GCC, so this change should make it work for everyone.