From 60494752b222d8269c23282296dc305d0318dd54 Mon Sep 17 00:00:00 2001 From: Dennis Sperzel Date: Mon, 5 Feb 2024 10:45:53 +0100 Subject: [PATCH] addition read sign out of number --- src/addition.c | 4 ++++ src/addition.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/addition.c b/src/addition.c index 0298801..ca1d9ed 100644 --- a/src/addition.c +++ b/src/addition.c @@ -24,6 +24,10 @@ unsigned int addition(num number1, num number2) { return result; } +unsigned int s(unsigned int a) { + return a >> 31; +} + float addition_float(float a, float b) { return 0.0; } \ No newline at end of file diff --git a/src/addition.h b/src/addition.h index 0898765..80ede14 100644 --- a/src/addition.h +++ b/src/addition.h @@ -7,6 +7,8 @@ void full_adder (num* sum, num* nextcarry, num number1, num number2, num carry); unsigned int addition(num a, num b); +unsigned int s(unsigned int a); + float addition_float(float a, float b); #endif // ADDITION_H