aboutsummaryrefslogtreecommitdiffstats
path: root/math/ldiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/ldiv.c')
-rw-r--r--math/ldiv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/math/ldiv.c b/math/ldiv.c
new file mode 100644
index 0000000..c45a6e6
--- /dev/null
+++ b/math/ldiv.c
@@ -0,0 +1,7 @@
+#include "maths.h"
+
+ldiv_t ldiv(long numerator, long denominator)
+{
+ return (ldiv_t){.quot = numerator / denominator,
+ .rem = numerator % denominator};
+}