summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-24 14:56:00 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-24 14:56:00 -0500
commit8c5eb397121c7fb3fa7feb2391d7c9b674b4190b (patch)
treecee9002f9e748eb4ca1861dd137abf366ac0ecba /math.c
parentb9079377328e9abeb20950ac144a7ebd98fde88e (diff)
file selector much nicer interface
Diffstat (limited to 'math.c')
-rw-r--r--math.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/math.c b/math.c
index c920a80..af89421 100644
--- a/math.c
+++ b/math.c
@@ -82,6 +82,12 @@ static u32 maxu32(u32 a, u32 b) {
return a > b ? a : b;
}
+static i64 mod_i64(i64 a, i64 b) {
+ i64 ret = a % b;
+ if (ret < 0) ret += b;
+ return ret;
+}
+
static float sgnf(float x) {
if (x < 0) return -1;
if (x > 0) return +1;