Browse Source

added type float to multiplication

remotes/origin/develop
Sandro Welte 11 months ago
parent
commit
5a6c45a9fd
  1. 12
      src/arithmeticMultiplication_Float.c
  2. 13
      src/arithmeticMultiplication_Float.h

12
src/arithmeticMultiplication_Float.c

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

13
src/arithmeticMultiplication_Float.h

@ -0,0 +1,13 @@
#ifndef THEADMIRALS_ARITHMETICMULTIPLICATION_FLOAT_H
#define THEADMIRALS_ARITHMETICMULTIPLICATION_FLOAT_H
float* multiplication_float(float num1, float num2);
#endif //THEADMIRALS_ARITHMETICMULTIPLICATION_FLOAT_H
Loading…
Cancel
Save