From 38e96b104df0e84754402172286cee8db570e559 Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 22:49:00 +0100 Subject: [PATCH] refactoring: added descriptions for division cases --- src/arithmeticDivision.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arithmeticDivision.c b/src/arithmeticDivision.c index 4bb8a58..c29e7dd 100644 --- a/src/arithmeticDivision.c +++ b/src/arithmeticDivision.c @@ -4,6 +4,7 @@ #include int* division_integer(int dividend, int divisor) { + // division with 0 would cause errors if(divisor == 0) { return NULL; } @@ -17,6 +18,7 @@ int* division_integer(int dividend, int divisor) { } long* division_long(long dividend, long divisor) { + // division with 0 would cause errors if(divisor == 0) { return NULL; } @@ -26,6 +28,7 @@ long* division_long(long dividend, long divisor) { } double* division_double(double dividend, double divisor) { + // division with 0 would cause errors if(divisor == 0) { return NULL; } @@ -35,6 +38,7 @@ double* division_double(double dividend, double divisor) { } float* division_float(float dividend, float divisor) { + // division with 0 would cause errors if(divisor == 0) { return NULL; }