Expression that only result a natural number There's any math trick that can turn any negative number to 0?
I'm not sure if this is possible without conditional logic
f(x>=0) = x

f(x<0) = 0

 A: You can avoid absolute value (and therefore avoid "if") using
$$
f(x) = \frac{x + \sqrt{x^2}}{2}.
$$
I adopt the convention that $\sqrt{}$ is a function returning only the positive square root of its argument.
A: How about $f(x)=\frac{x+|x|}2$? The "if" is then hidden in the definition of absoulute value of course ...
A: It's surprisingly easy to write down the function $\max$ in terms of absolute values:
$$\max(x,y)=\frac{|x-y|+x+y}{2}$$
So just take $\max(x,0)$.
A: Computer science, and some branches of mathematics, deal with a "truncated subtraction" operator, $\dot-$ which is exactly what you want.  The value of $a\;\dot-\;b$ is defined to be the same as $a-b$ if $a$ is at least as big as $b$, and zero if it is smaller.
So you could say for example that $f(x) = x\;\dot-\;0$.
But this is just saying the same as what you said in your question, and making up a funny symbol for it. There is no reason why writing $x\;\dot-\;0$ is better than writing what you actually wrote.  So just write what you wrote and don't worry about the funny symbol.  No "math tricks" are needed. All that is needed is for you to say what you mean.
