summaryrefslogtreecommitdiff
path: root/userland/libc/stdlib/abs.c
diff options
context:
space:
mode:
Diffstat (limited to 'userland/libc/stdlib/abs.c')
-rw-r--r--userland/libc/stdlib/abs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/userland/libc/stdlib/abs.c b/userland/libc/stdlib/abs.c
new file mode 100644
index 0000000..1079beb
--- /dev/null
+++ b/userland/libc/stdlib/abs.c
@@ -0,0 +1,3 @@
+#include <stdlib.h>
+
+int abs(int i) { return (i < 0) ? (-i) : (i); }