From db69a56b09e6ccf64c784dd054f8f3f94b0e213a Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 19:19:50 +0100 Subject: [PATCH] Expanded arithmetic addition by double calculation --- src/arithmeticAddition.c | 6 ++++++ src/arithmeticAddition.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/arithmeticAddition.c b/src/arithmeticAddition.c index d75b63f..81ba426 100644 --- a/src/arithmeticAddition.c +++ b/src/arithmeticAddition.c @@ -10,4 +10,10 @@ int* addition_integer(int num1, int num2) { int* result = malloc(sizeof(int)); *result = num1 + num2; return result; +} + +double* addition_double(double num1, double num2) { + double* result = malloc(sizeof(double)); + *result = num1+num2; + return result; } \ No newline at end of file diff --git a/src/arithmeticAddition.h b/src/arithmeticAddition.h index 92907ff..ab7db2a 100644 --- a/src/arithmeticAddition.h +++ b/src/arithmeticAddition.h @@ -3,4 +3,6 @@ int* addition_integer(int, int); +double* addition_double(double, double); + #endif //THEADMIRALS_ARITHMETICADDITION_H