about summary refs log tree commit diff
path: root/src/stdlib/imaxabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/imaxabs.c')
-rw-r--r--src/stdlib/imaxabs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stdlib/imaxabs.c b/src/stdlib/imaxabs.c
new file mode 100644
index 00000000..81001819
--- /dev/null
+++ b/src/stdlib/imaxabs.c
@@ -0,0 +1,6 @@
+#include <inttypes.h>
+
+intmax_t imaxabs(intmax_t a)
+{
+	return a>0 ? a : -a;
+}