Browse Source

Expanded arithmetic division with datatype

remotes/origin/develop
Eric Bagus 11 months ago
parent
commit
c0b2e43eb8
  1. 9
      src/arithmeticDivision.c
  2. 2
      src/arithmeticDivision.h

9
src/arithmeticDivision.c

@ -33,3 +33,12 @@ double* division_double(double dividend, double divisor) {
*result = dividend / divisor;
return result;
}
float* division_float(float dividend, float divisor) {
if(divisor == 0) {
return NULL;
}
float* result = malloc(sizeof(float));
*result = dividend / divisor;
return result;
}

2
src/arithmeticDivision.h

@ -7,4 +7,6 @@ long* division_long(long, long);
double* division_double(double, double);
float* division_float(float, float);
#endif //THEADMIRALS_ARITHMETICDIVISION_H
Loading…
Cancel
Save