A poorly written OS for the x86 arch. (WIP)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
eOS/lib/math.c

19 lines
240 B

#include "math.h"
long pow(int num, uint expon) {
long prod = 1;
while(expon > 0)
prod *= num;
expon--;
return prod;
}
long square(uint num) {
long sum = num - 1;
while(num > 0) {
sum += num*2;
num--;
}
return sum + 1;
}