summaryrefslogtreecommitdiff
path: root/include/math_util.h
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-06-04 09:10:09 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-06-04 09:10:09 -0400
commit75ab879fd876d35eac8498296994278e213b6e7a (patch)
treeb9763615e9771ac5dce777031a80b57b12d9cac2 /include/math_util.h
parente82080d42bbb81b2add8bef5c073cc353dfea307 (diff)
parent2d3210dc1129e3d60a9d138838dc867d8b106b41 (diff)
Merge remote-tracking branch 'origin/master' into modern_ld
Diffstat (limited to 'include/math_util.h')
-rw-r--r--include/math_util.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/math_util.h b/include/math_util.h
index 9f9677463..1f8edc5d9 100644
--- a/include/math_util.h
+++ b/include/math_util.h
@@ -1,11 +1,21 @@
#ifndef GUARD_MATH_UTIL_H
#define GUARD_MATH_UTIL_H
-s16 MathUtil_Inv16(s16 y);
-s16 MathUtil_Mul16(s16 x, s16 y);
-s32 MathUtil_Div32(s32 x, s32 y);
-s32 MathUtil_Mul32(s32 x, s32 y);
-s16 MathUtil_Div16Shift(u8 s, s16 x, s16 y);
-s16 MathUtil_Mul16Shift(u8 s, s16 x, s16 y);
+// Fixed-point arithmetic library.
+
+// x * y
+s16 Q_8_8_mul(s16 x, s16 y);
+s16 Q_N_S_mul(u8 s, s16 x, s16 y);
+s32 Q_24_8_mul(s32 x, s32 y);
+
+// x / y
+s16 Q_8_8_div(s16 x, s16 y);
+s16 Q_N_S_div(u8 s, s16 x, s16 y);
+s32 Q_24_8_div(s32 x, s32 y);
+
+// 1.0 / y
+s16 Q_8_8_inv(s16 y);
+s16 Q_N_S_inv(u8 s, s16 y);
+s32 Q_24_8_inv(s32 y);
#endif //GUARD_MATH_UTIL_H