Useless square function?

rust
E. Almqvist 3 years ago
parent 2dbd087c4e
commit 21d537ed76
  1. 9
      lib/math.c
  2. 1
      lib/math.h

@ -8,3 +8,12 @@ long pow(int num, uint expon) {
return prod;
}
long square(uint num) {
long sum = num - 1;
while(num > 0) {
sum += num*2;
sum--;
}
return sum + 1;
}

@ -1,3 +1,4 @@
#include "types.h"
long pow(int, uint);
long square(int);

Loading…
Cancel
Save