summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/ldiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/ldiv.c')
-rw-r--r--lib/libc/stdlib/ldiv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc/stdlib/ldiv.c b/lib/libc/stdlib/ldiv.c
new file mode 100644
index 00000000..9fc62b8d
--- /dev/null
+++ b/lib/libc/stdlib/ldiv.c
@@ -0,0 +1,9 @@
+#include <stdlib.h>
+
+ldiv_t ldiv(long numer, long denom)
+{
+ ldiv_t result;
+ result.quot = numer / denom;
+ result.rem = numer % denom;
+ return result;
+}