From 3f5189f2219ef42bcd98e0c271d05830563d4332 Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 26 Jan 2024 22:58:09 +0100 Subject: [PATCH] feat: added mathext --- mathext.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mathext.h diff --git a/mathext.h b/mathext.h new file mode 100644 index 0000000..a15f6a7 --- /dev/null +++ b/mathext.h @@ -0,0 +1,9 @@ +#ifndef CUTES_MATHEXT_H +#define CUTES_MATHEXT_H + +#define MIN(x__, min__) (((x__)<=(min__))?(min__):(x__)) +#define MAX(x__, max__) (((x__)>=(max__))?(max__):(x__)) + +#define CLAMP(x__, min__, max__) MIN(MAX(x__, max__), min__) + +#endif // !CUTES_MATHEXT_H