Use uint64_t instead of size_t
Use std::isinf