From bdac4949b07635c67d517f0be7d58c07ce8eb4df Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 23:07:27 +0100 Subject: [PATCH] refactoring: changed descriptions and edited layout --- src/arithmeticMultiplication_Int.c | 4 ---- src/arithmeticSubtraction.c | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/arithmeticMultiplication_Int.c b/src/arithmeticMultiplication_Int.c index 6aaea5f..a00b05d 100644 --- a/src/arithmeticMultiplication_Int.c +++ b/src/arithmeticMultiplication_Int.c @@ -1,15 +1,11 @@ - - #include "arithmeticMultiplication_Int.h" #include int* multiplication_integer(int a, int b) { int *result = (int*)malloc(sizeof(int)); if (result == NULL) { - return NULL; } - *result = a * b; return result; diff --git a/src/arithmeticSubtraction.c b/src/arithmeticSubtraction.c index ed08d04..bbabad9 100644 --- a/src/arithmeticSubtraction.c +++ b/src/arithmeticSubtraction.c @@ -1,20 +1,22 @@ - #include "arithmeticSubtraction.h" #include -//arithmetic Subtraction specification integer + +// arithmetic subtraction integer int* subtraction_integer(int a, int b) { int* result= malloc(sizeof (int)); *result=a - b; return result; } -//arithmetic Subtraction specification float + +// arithmetic subtraction float float* subtraction_float(float a, float b) { float* result= malloc(sizeof (float)); *result=a - b; return result; } -//arithmetic Subtraction specification double + +// arithmetic subtraction double double* subtraction_double(double a, double b) { double* result= malloc(sizeof (double)); *result=a - b;