summaryrefslogtreecommitdiff
path: root/src/code/fmodf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/code/fmodf.c')
-rw-r--r--src/code/fmodf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/code/fmodf.c b/src/code/fmodf.c
new file mode 100644
index 000000000..6cc69dd87
--- /dev/null
+++ b/src/code/fmodf.c
@@ -0,0 +1,12 @@
+#include "global.h"
+
+f32 fmodf(f32 x, f32 y) {
+ s32 quot;
+
+ if (y == 0.0f) {
+ return 0.0f;
+ }
+ quot = x / y;
+
+ return x - (quot * y);
+}