Can we Clamp and Clip numbers mathematically? While programming I came up with a the following equation / workflow
clampValue = (value - minValueofRange) / (maxValueofRange - minValueofRange);
clippedValue = min(1, max(0, clampValue));
finalValue = clippedValue * scale;

Now the clipping ultimately causes an if and else in programming. Can we convert it completely to a mathematical equation?
Edit:
max and min are functions in c++ defined like:
int max(int v1, int v2){
    if(v1 > v2) return v1;
    else return v2;
}

Similar for the min() function

Using a piecewise function as in T. Linnell's answer or simply writing something like $\min(1,\max(0,c))$ would be clear and absolutely fine in mathematics.
If you just happen to be curious about how to represent $\min$ and $\max$ in a different way, $\max(a,b)=\dfrac{|a-b|+a+b}{2}$ and $\min(a,b)=\dfrac{a+b-|a-b|}{2}$.
