From e72bf038444e32120037b02e9b56e7c0ae47990c Mon Sep 17 00:00:00 2001 From: Samuel Herts Date: Mon, 16 Sep 2024 11:15:25 -0400 Subject: [PATCH] revert type declaration for overflow bug --- bigint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigint.h b/bigint.h index 01b8bb6..522a7c2 100644 --- a/bigint.h +++ b/bigint.h @@ -494,7 +494,7 @@ namespace BigInt { std::transform(lhs.vec.rbegin(), lhs.vec.rend(), full_rhs.vec.rbegin(), carry_result.rbegin(), add_with_carry); std::vector final(lhs.vec.size() + 1); - for (auto i = carry_result.size() - 1; i >= 0; --i) { + for (int i = carry_result.size() - 1; i >= 0; --i) { final[i] += carry_result[i].second; final[i - 1] += carry_result[i].first; } @@ -552,7 +552,7 @@ namespace BigInt { subtract_with_borrow); std::vector final(lhs.vec.size()); - for (auto i = borrow_result.size() - 1; i >= 0; --i) { + for (int i = borrow_result.size() - 1; i >= 0; --i) { final[i] += borrow_result[i].second; if (borrow_result[i].first) final[i - 1] -= borrow_result[i].first;