diff --git a/src/arithmeticDivision.c b/src/arithmeticDivision.c index 7cdfc7e..34949dd 100644 --- a/src/arithmeticDivision.c +++ b/src/arithmeticDivision.c @@ -14,4 +14,13 @@ int* division_integer(int dividend, int divisor) { int* result = malloc(sizeof(int)); *result = dividend / divisor; return result; +} + +long* division_long(long num1, long num2) { + if(num2 == 0) { + return NULL; + } + long* result = malloc(sizeof(long)); + *result = num1 / num2; + return result; } \ No newline at end of file diff --git a/src/arithmeticDivision.h b/src/arithmeticDivision.h index e4080b7..08bc4f5 100644 --- a/src/arithmeticDivision.h +++ b/src/arithmeticDivision.h @@ -3,4 +3,6 @@ int* division_integer(int, int); +long* division_long(long, long); + #endif //THEADMIRALS_ARITHMETICDIVISION_H