aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-07-11 08:12:48 +0200
committerAnton Khirnov <anton@khirnov.net>2022-07-29 11:35:58 +0200
commitc01eecbfbafedef629e510b2ee3fd28863a70779 (patch)
treeab49fbd88bc3ea107ce796a637c8df6efdb87d70 /common.h
parentcde358a309c3dbf8d4249229f10d0888f307e7f9 (diff)
Add a module for adaptive step control.
Diffstat (limited to 'common.h')
-rw-r--r--common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/common.h b/common.h
index 9c36a33..d6f55f0 100644
--- a/common.h
+++ b/common.h
@@ -22,6 +22,7 @@
#define SGN(x) ((x) >= 0.0 ? 1.0 : -1.0)
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) > (y) ? (y) : (x))
+#define CLIP(val, min, max) (MIN(MAX(val, min), max))
#define ARRAY_ELEMS(arr) (sizeof(arr) / sizeof(*arr))
#include <stdio.h>