Browse Source

refactoring: added descriptions for division cases

remotes/origin/develop
Eric Bagus 11 months ago
parent
commit
38e96b104d
  1. 4
      src/arithmeticDivision.c

4
src/arithmeticDivision.c

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
int* division_integer(int dividend, int divisor) { int* division_integer(int dividend, int divisor) {
// division with 0 would cause errors
if(divisor == 0) { if(divisor == 0) {
return NULL; return NULL;
} }
@ -17,6 +18,7 @@ int* division_integer(int dividend, int divisor) {
} }
long* division_long(long dividend, long divisor) { long* division_long(long dividend, long divisor) {
// division with 0 would cause errors
if(divisor == 0) { if(divisor == 0) {
return NULL; return NULL;
} }
@ -26,6 +28,7 @@ long* division_long(long dividend, long divisor) {
} }
double* division_double(double dividend, double divisor) { double* division_double(double dividend, double divisor) {
// division with 0 would cause errors
if(divisor == 0) { if(divisor == 0) {
return NULL; return NULL;
} }
@ -35,6 +38,7 @@ double* division_double(double dividend, double divisor) {
} }
float* division_float(float dividend, float divisor) { float* division_float(float dividend, float divisor) {
// division with 0 would cause errors
if(divisor == 0) { if(divisor == 0) {
return NULL; return NULL;
} }

Loading…
Cancel
Save