diff options
Diffstat (limited to 'src/extlib.h')
-rw-r--r-- | src/extlib.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/extlib.h b/src/extlib.h index c62c374..c36b919 100644 --- a/src/extlib.h +++ b/src/extlib.h @@ -67,3 +67,12 @@ char *replace_str (char *s, char *old, char *replace); /// Join an array of strings into one string char *join_str (char **s, size_t len, char delim); + +/// Limit a value to a maximum +float max (float v, float max_v); + +/// Limit a value to a minimum +float min (float v, float min_v); + +/// Limit a value between min and max +float cap (float v, float min_v, float max_v); |