diff --git a/src/fileHandle.c b/src/fileHandle.c index 8344c48..3a1ef40 100644 --- a/src/fileHandle.c +++ b/src/fileHandle.c @@ -27,7 +27,6 @@ long reader(long fd, char *string){ syscall3(SYS_read, fd, (long)string, sizeof(string)-1); } - // does that it say on the tin long mkdir(const char *filePath, int mode){ syscall2(SYS_mkdir, (long)filePath, mode); diff --git a/src/funcs.c b/src/funcs.c index cd2ccda..6ce99e6 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -5,6 +5,7 @@ #include "stdWullie.h" #include "localheader.h" +// generic functions that dont need a file of there own // our own exit LINUX ONLY void exit(int code){ diff --git a/src/main.c b/src/main.c index c169bc2..9517c7a 100644 --- a/src/main.c +++ b/src/main.c @@ -45,6 +45,14 @@ int main(int argc, char *argv[]){ mkdir("test", 0); break; + case 6: + print("turning a int to string: "); + int num = 8001; + char *str = intCon(num); + print(str); + print("\n"); + break; + default: print("no args given or arg is out of range\n"); break; diff --git a/src/math.c b/src/math.c index d7db1d5..5ab3824 100644 --- a/src/math.c +++ b/src/math.c @@ -20,8 +20,43 @@ int intParser(char *rawInt){ float invSqrt(float x){ float xhalf = 0.5f * x; int i = *(int*)&x; - i = 0x5f3759df - (i >> 1); + i = 0x5f3759df - (i >> 1); // bit fuck magic x = *(float*)&i; x = x*(1.5f - xhalf*x*x); return x; } + + +// power of for floats +float floatPow(float base, int exponant){ + float result; + + if(base == 0.0f || exponant == 0){ + result = 0.0f; + return result; + + } + while(exponant > 0){ + result = base * base; + exponant --; + } + +} + + +// power of for int +int intPow(int base, int exponant){ + int result; + + if(base == 0 || exponant == 0){ + result = 0; + return result; + } + + result = base ^ exponant; + return result; +} + +float Sqrt(){ + +}