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