aboutsummaryrefslogtreecommitdiff
path: root/src/libc/math.c
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-13 18:09:43 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-13 18:09:43 +0200
commite1e75aa387b1bc2b80df1895131fa9d446bba9ac (patch)
tree12b5a3b412ab4d4c6a24ea894025d6dbf65b8ac1 /src/libc/math.c
parent5a9a57177f730d1c00ab2b47f91e5ea2660a4f77 (diff)
Cleaning code
Diffstat (limited to 'src/libc/math.c')
-rw-r--r--src/libc/math.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libc/math.c b/src/libc/math.c
index 2051dc1..80b1d3a 100644
--- a/src/libc/math.c
+++ b/src/libc/math.c
@@ -11,4 +11,22 @@ int pow(int x,int n){
for(int i=0;i<(n-1);i++)
ret*=x;
return ret;
+}
+
+int max(int x,int y){
+ if(x>y)
+ return x;
+ return y;
+}
+
+int min(int x,int y){
+ if(x<y)
+ return x;
+ return y;
+}
+
+int abs(int x){
+ if(x<0)
+ return -x;
+ return x;
} \ No newline at end of file