summaryrefslogtreecommitdiff
path: root/lib/libc/inttypes/imaxdiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/inttypes/imaxdiv.c')
-rw-r--r--lib/libc/inttypes/imaxdiv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/inttypes/imaxdiv.c b/lib/libc/inttypes/imaxdiv.c
new file mode 100644
index 00000000..36fd6d20
--- /dev/null
+++ b/lib/libc/inttypes/imaxdiv.c
@@ -0,0 +1,6 @@
+#include <inttypes.h>
+
+imaxdiv_t imaxdiv(intmax_t num, intmax_t den)
+{
+ return (imaxdiv_t){ num / den, num % den };
+}