To avoid changing semantics inadvertently, this patch casts arguments to uint64_t before calling std::gcd.