fix the "only <double> can be queried for NaN" exceptions

seems like some compilers don't overwrite an inline method of a
template class with its specialization. A compiler warning would have
been nice to have in this case, though...