MCPcopy Create free account
hub / github.com/VCVRack/Rack / clampSafe

Function clampSafe

include/math.hpp:39–41  ·  view source on GitHub ↗

Limits `x` between `a` and `b`. If `b < a`, switches the two values. */

Source from the content-addressed store, hash-verified

37If `b < a`, switches the two values.
38*/
39inline int clampSafe(int x, int a, int b) {
40 return (a <= b) ? clamp(x, a, b) : clamp(x, b, a);
41}
42
43/** Euclidean modulus. Always returns `0 <= mod < b`.
44`b` must be positive.

Callers 7

setValueMethod · 0.85
setImmediateValueMethod · 0.85
clamp2Function · 0.85
clamp2fFunction · 0.85
clampMethod · 0.85
nudgeMethod · 0.85
clampSafeMethod · 0.85

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected