From b17b37d57b2497012ba52e71a2b45b0446ed97f2 Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 20:17:10 +0100 Subject: [PATCH] refactoring: changed double division variables and removed spaces --- src/arithmeticDivision.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/arithmeticDivision.c b/src/arithmeticDivision.c index 3233c7b..0090bbd 100644 --- a/src/arithmeticDivision.c +++ b/src/arithmeticDivision.c @@ -25,14 +25,11 @@ long* division_long(long dividend, long divisor) { return result; } -double* division_double(double num1, double num2) { - if(num2 == 0) { +double* division_double(double dividend, double divisor) { + if(divisor == 0) { return NULL; } - - - double* result = malloc(sizeof(double )); - *result = num1 / num2; + *result = dividend / divisor; return result; } \ No newline at end of file