summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils.c b/utils.c
new file mode 100644
index 0000000..e3f79f9
--- /dev/null
+++ b/utils.c
@@ -0,0 +1,25 @@
+#include <stddef.h> // for int
+#include <math.h> // for floorf()
+#include "utils.h"
+
+int
+min_int(int a, int b)
+{
+ return (a < b) ? a : b;
+}
+size_t
+min_size_t(size_t a, size_t b)
+{
+ return (a < b) ? a : b;
+}
+
+int
+max_int(int a, int b)
+{
+ return (a > b) ? a : b;
+}
+size_t
+max_size_t(size_t a, size_t b)
+{
+ return (a > b) ? a : b;
+}