make multiplication 64-bit

This commit is contained in:
Krishna Vedala 2020-06-22 16:21:57 -04:00
parent fb82e9050d
commit 8736dce71a
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -264,7 +264,7 @@ class large_number {
size_t i; size_t i;
uint64_t carry = 0, temp; uint64_t carry = 0, temp;
for (i = 0; i < this->num_digits(); i++) { for (i = 0; i < this->num_digits(); i++) {
temp = (*this)[i] * n; temp = static_cast<uint64_t>((*this)[i]) * n;
temp += carry; temp += carry;
if (temp < 10) { if (temp < 10) {
carry = 0; carry = 0;