mirror of
https://github.com/halpz/re3.git
synced 2025-07-16 15:28:11 +00:00
another clamp
This commit is contained in:
@ -219,6 +219,8 @@ extern int strncasecmp(const char *str1, const char *str2, size_t len);
|
||||
|
||||
#define clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v))
|
||||
|
||||
#define clamp2(v, center, radius) ((v) < (center) ? Max(v, center - radius) : Min(v, center + radius))
|
||||
|
||||
inline float sq(float x) { return x*x; }
|
||||
#define SQR(x) ((x) * (x))
|
||||
|
||||
|
Reference in New Issue
Block a user