From b7ac144cd2d242791938b51569effb7a1378a332 Mon Sep 17 00:00:00 2001 From: noodle Date: Mon, 10 Jul 2023 15:40:08 +0300 Subject: Add files --- utils.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 utils.c (limited to 'utils.c') 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 // for int +#include // 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; +} -- cgit v1.2.3