there are several functions in math.c with code such as the following:
float result = 0;
for (int i = 0; i < TERMS; i++) {
// mutate result
return result;
}
This causes the loop to always run only once instead of seven times as would be appropriate due to the definition of TERMS in math.h. If this is the intention, it is probably better to not use a for loop at all and just return a value without any for loop or mutation. Otherwise, the return statement should be after the for loop.
there are several functions in math.c with code such as the following:
This causes the loop to always run only once instead of seven times as would be appropriate due to the definition of TERMS in
math.h
. If this is the intention, it is probably better to not use a for loop at all and just return a value without any for loop or mutation. Otherwise, the return statement should be after the for loop.