Browse Source

added type double to multiplication

remotes/origin/develop
Sandro Welte 11 months ago
parent
commit
f6dffc93d3
  1. 12
      src/arithmeticMultiplication_Double.c
  2. 14
      src/arithmeticMultiplication_Double.h

12
src/arithmeticMultiplication_Double.c

@ -0,0 +1,12 @@
#include "stdlib.h"
#include "arithmeticMultiplication_Double.h"
double* multiplication_double(double num1, double num2) {
double* result = (double*)malloc(sizeof(double));
if (result == NULL) {
return NULL; // Handle memory allocation failure
}
*result = num1 * num2;
return result;
}

14
src/arithmeticMultiplication_Double.h

@ -0,0 +1,14 @@
#ifndef THEADMIRALS_ARITHMETICMULTIPLICATION_DOUBLE_H
#define THEADMIRALS_ARITHMETICMULTIPLICATION_DOUBLE_H
double* multiplication_double(double num1, double num2);
#endif //THEADMIRALS_ARITHMETICMULTIPLICATION_DOUBLE_H
Loading…
Cancel
Save