From faee79b2bd2b9659f5279cb1b4e5672920493b61 Mon Sep 17 00:00:00 2001 From: Dennis Sperzel Date: Thu, 1 Feb 2024 08:43:15 +0100 Subject: [PATCH] addition for all unsigned integer (modulo UNIT_MAX) --- src/addition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addition.c b/src/addition.c index 0bdb599..adfc3fe 100644 --- a/src/addition.c +++ b/src/addition.c @@ -12,7 +12,7 @@ unsigned int addition(num number1, num number2) { num sum[1] = {0}; num nextcarry[1] = {0}; - for (int i = 0; i < 2; i++) + for (int i = 0; i < 8 * sizeof(num); i++) { full_adder(sum, nextcarry, number1, number2, nextcarry[0]); result ^= (sum[0] << i);