diff options
author | quou <quou@disroot.org> | 2024-06-01 12:19:16 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-06-01 12:20:17 +1000 |
commit | ea7cd94f7aeb177618db3907a6c86b7252e018f0 (patch) | |
tree | e972f9cf590ef756c2e41f3eac5b03e16db08300 /maths.h |
Initial commit.
Diffstat (limited to 'maths.h')
-rw-r--r-- | maths.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +#ifndef maths_h +#define maths_h + +#define mini(a_, b_) ((a_) < (b_) ? (a_) : (b_)) +#define maxi(a_, b_) ((a_) > (b_) ? (a_) : (b_)) +#define sign(n_) ((n_ < 0) ? -1 : 1) +#define clamp(v_, min_, max_) (maxi(min_, mini(max_, v_))) + +#endif |