summaryrefslogtreecommitdiff
path: root/include/lib
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2024-03-19 17:13:26 +0100
committerAetias <aetias@outlook.com>2024-03-19 17:13:26 +0100
commit064086da4fd3f65da99c85abf44eb56b969c63a5 (patch)
treee10ff9ee35bde899f66a2bbe790ef828c15c0385 /include/lib
parent9f2dbce3b96acdbbc2071ca909118ef033fee27a (diff)
Prefer signed integers
Diffstat (limited to 'include/lib')
-rw-r--r--include/lib/math.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/lib/math.h b/include/lib/math.h
index 67a8b9cc..86c483a0 100644
--- a/include/lib/math.h
+++ b/include/lib/math.h
@@ -4,7 +4,9 @@
#include "types.h"
// Q20.12 fixed point number
-typedef u32 q20;
+typedef s32 q20;
+// Q4.12 fixed point number
+typedef s16 q4;
#define INT_TO_Q20(n) ((s32)((n) << 12))
#define FLOAT_TO_Q20(n) ((s32)(((n) * 8192 + 1) / 2))