Is there a predefined mathematical function for $ f(x) = \left\{\begin{aligned} &x &&: x < n\\ &x - n &&: x \ge n \end{aligned} \right.$ if n is a constant, is there a predefined/shorter mathematical function that can replace this function :
$$
f(x) = \left\{\begin{aligned}
&amp;x &amp;&amp;: x &lt; n\\
&amp;x - n &amp;&amp;: x \ge n
\end{aligned}
\right.$$

where x >= 0 and x &lt; 2n
You can build this function from the Heaviside step:

$$f(x):= x-nH(x-n).$$

Make sure to use the convention $H(0):=1.$
actually there IS a function that can do the same, which is the modulus

the above function is the same as

x mod n

although it isn't true for all values of x, it's what I have been looking for