diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2024-11-06 16:47:58 -0500 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2024-11-06 16:47:58 -0500 |
| commit | 25f6797ab86700fa301423e003f32d770845d0e1 (patch) | |
| tree | 54afdf24ff243b9a9509ebdf6b5ebdeae408423e /include/c | |
| parent | aaf88fa648557435a2af5c4bc1436507c2b0042c (diff) | |
oops
Diffstat (limited to 'include/c')
| -rw-r--r-- | include/c/c_math.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/c/c_math.h b/include/c/c_math.h index ee21fe0d..f9e6309a 100644 --- a/include/c/c_math.h +++ b/include/c/c_math.h @@ -11,7 +11,7 @@ int rndInt(int max); f32 rndF(f32 max); f32 rndFX(f32 amp); -template <typename T> +template <typename T> T rndRange(T min, T max) { f32 r = cM::rndF(max - min); f32 m = min; @@ -19,6 +19,7 @@ T rndRange(T min, T max) { return m; } +template <typename T> inline T minMaxLimit(T val, T min, T max) { return (T)((T)val < (T)min ? (T)min : ((T)val > (T)max ? (T)max : (T)val)); } |
