summaryrefslogtreecommitdiff
path: root/src/code/fmodf.c
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2022-03-01 19:29:42 +0000
committerGitHub <noreply@github.com>2022-03-01 20:29:42 +0100
commit362bc5e61353d2ffb9767f15ab649fbfa5ac4cf4 (patch)
tree952ff32ad819dab2b734ebddf6242b5cd61e2d72 /src/code/fmodf.c
parented6ec5bceb667f10faf2b0672e273c78feba971e (diff)
Name fmodf (#1162)
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);
+}