Upload files to "src"
This commit is contained in:
@@ -27,7 +27,6 @@ long reader(long fd, char *string){
|
|||||||
syscall3(SYS_read, fd, (long)string, sizeof(string)-1);
|
syscall3(SYS_read, fd, (long)string, sizeof(string)-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// does that it say on the tin
|
// does that it say on the tin
|
||||||
long mkdir(const char *filePath, int mode){
|
long mkdir(const char *filePath, int mode){
|
||||||
syscall2(SYS_mkdir, (long)filePath, mode);
|
syscall2(SYS_mkdir, (long)filePath, mode);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "stdWullie.h"
|
#include "stdWullie.h"
|
||||||
#include "localheader.h"
|
#include "localheader.h"
|
||||||
|
|
||||||
|
// generic functions that dont need a file of there own
|
||||||
|
|
||||||
// our own exit LINUX ONLY
|
// our own exit LINUX ONLY
|
||||||
void exit(int code){
|
void exit(int code){
|
||||||
|
|||||||
@@ -45,6 +45,14 @@ int main(int argc, char *argv[]){
|
|||||||
mkdir("test", 0);
|
mkdir("test", 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
print("turning a int to string: ");
|
||||||
|
int num = 8001;
|
||||||
|
char *str = intCon(num);
|
||||||
|
print(str);
|
||||||
|
print("\n");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
print("no args given or arg is out of range\n");
|
print("no args given or arg is out of range\n");
|
||||||
break;
|
break;
|
||||||
|
|||||||
37
src/math.c
37
src/math.c
@@ -20,8 +20,43 @@ int intParser(char *rawInt){
|
|||||||
float invSqrt(float x){
|
float invSqrt(float x){
|
||||||
float xhalf = 0.5f * x;
|
float xhalf = 0.5f * x;
|
||||||
int i = *(int*)&x;
|
int i = *(int*)&x;
|
||||||
i = 0x5f3759df - (i >> 1);
|
i = 0x5f3759df - (i >> 1); // bit fuck magic
|
||||||
x = *(float*)&i;
|
x = *(float*)&i;
|
||||||
x = x*(1.5f - xhalf*x*x);
|
x = x*(1.5f - xhalf*x*x);
|
||||||
return 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(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user