From d6758cbe13bdc0dc807d27f37198bc082e98998b Mon Sep 17 00:00:00 2001 From: fdai7968 Date: Thu, 8 Feb 2024 16:25:48 +0000 Subject: [PATCH] refactoring: if divident and divisor is the same return 1 --- src/division/division.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/division/division.c b/src/division/division.c index 7cf98ef..e0765f6 100644 --- a/src/division/division.c +++ b/src/division/division.c @@ -5,5 +5,6 @@ float divide(float dividend, float divisor) { return 0; // Fehlerbehandlung: Division durch Null ist nicht definiert, daher geben wir einfach 0 zurück. } if (dividend == 0) return 0; + else if(dividend==divisor) return 1; else return dividend / divisor; }