Where can I find clamp in the C# class library?
- by Danvil
I would like to clamp a value x to a range [a, b]:
T x = (x < a) ? a : ((x > b) ? b : x);
This is quite basic. But I do not see a function "clamp" in the class library - at least not in System.Math.