clamp

fnT clamp(T)(T x, T a, T b) @safe nothrow @nogc

Returns x clamped to the range [a, b].