diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-09 10:29:23 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-09 10:29:23 +0200 |
| commit | f6323421e22c3585c58b54658a11e1e4706cc8fa (patch) | |
| tree | f317b7129dc4350fd088b59a43c1b6e80cd5c39b /src/libc/math.c | |
| parent | 8fee35522dee033863f68c1d2b45f5fe988de9eb (diff) | |
Cleaning code and provide minimal libc
Diffstat (limited to 'src/libc/math.c')
| -rw-r--r-- | src/libc/math.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libc/math.c b/src/libc/math.c new file mode 100644 index 0000000..2051dc1 --- /dev/null +++ b/src/libc/math.c @@ -0,0 +1,14 @@ +#include "math.h" + +int pow(int x,int n){ + if(n<0) + return -1; + else if(n==0) + return 1; + else if(n==1) + return x; + int ret=x; + for(int i=0;i<(n-1);i++) + ret*=x; + return ret; +}
\ No newline at end of file |
