From 36035dbc001ea380c7f911af5c04750c8201e4c1 Mon Sep 17 00:00:00 2001 From: cxnnqr Date: Tue, 6 Feb 2024 13:35:25 +0100 Subject: [PATCH] refactoring: changed back to longer version for better overview and understanding --- src/kgV/kgV.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kgV/kgV.c b/src/kgV/kgV.c index 6c6ae52..0bdb026 100644 --- a/src/kgV/kgV.c +++ b/src/kgV/kgV.c @@ -8,5 +8,10 @@ int kgV(int a, int b){ if(a == 0 || b == 0) return 0; // Regular case of calculating the kgV - return abs(a*b/ ggT(a, b)); + int kgV = a*b/ ggT(a, b); + + // Getting the absolute value of the kgV + int absoluteKgV = abs(kgV); + + return absoluteKgV; } \ No newline at end of file