From 677a3b6e9e712a31f04ddb10556ee9f83cfd8b1d Mon Sep 17 00:00:00 2001 From: Dennis Sperzel Date: Mon, 5 Feb 2024 14:00:39 +0100 Subject: [PATCH] addition addition_float base case 0+number=number --- src/addition.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/addition.c b/src/addition.c index 6afc239..fcf652b 100644 --- a/src/addition.c +++ b/src/addition.c @@ -51,5 +51,7 @@ unsigned int e(unsigned int a) { // addition of two floating numbers float addition_float(float number1, float number2) { - return 0.0; + if (number2 == (float) 0.0) return number1; + else if (number1 == (float) 0.0) return number2; + return (float) 0.0; } \ No newline at end of file