|
@ -32,4 +32,13 @@ double* division_double(double dividend, double divisor) { |
|
|
double* result = malloc(sizeof(double )); |
|
|
double* result = malloc(sizeof(double )); |
|
|
*result = dividend / divisor; |
|
|
*result = dividend / divisor; |
|
|
return result; |
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float* division_float(float dividend, float divisor) { |
|
|
|
|
|
if(divisor == 0) { |
|
|
|
|
|
return NULL; |
|
|
|
|
|
} |
|
|
|
|
|
float* result = malloc(sizeof(float)); |
|
|
|
|
|
*result = dividend / divisor; |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |