Return 0 for negative numbers using a short list of functions I'm using a CAD software that allows you to calculate a value using a small set of built in functions. I have the formula complete for the input (call it 'x') of this formula, I just need to return either 0 if 'x' is negative or 'x' if not. 
Here's the list of formulas/functions available:


*

*ABS (absolute) 

*ACOS (Arccosine)

*ASIN (Arcsine)

*ATAN (Arctan)

*COS (Cosine)

*COSH (Hyperbolic Cosine)

*INT (Truncate to Integer)

*LOG (Log base e)

*LOG10 (Log base 10)

*SIN (Sine)

*SINH (Hyperbolic Sine)

*SQR (Square root)

*TAN (Tangent)

*TANH (Hyperbolic Tangent)


Is there anyway to achieve this?
Thanks in advance for any help!
 A: I think what you are looking for is $$\frac{x+|x|}{2}$$ which, for positive values of $x$, is $$\frac{x+x}{2}=x,$$
and for negative values of $x$ is $$\frac{x-x}{2}=0$$
A: The absolute value can be seen as a "decision function", as its behavior ($+x$ or $-x$) depends on the comparison $x\ge0$.
It can be used for a sign function,
$$\text{sgn}(x)=\frac{|x|}{x}$$ (provided $x\ne0$).
From this you deriv a "positive" function ($1$ for positive, $0$ otherwise),
$$\text{pos}(x)=\frac{\text{sgn}(x)+1}2.$$
Then
$$x\text{ pos}(x)=\frac{|x|+x}2$$ has the desired behavior (even for $x=0$).

If the range of $x$ is bounded ($|x|<X$), you can also exploit the floor function (INT), via
$$\text{pos}(x)=\left\lfloor\frac xX\right\rfloor+1.$$

In case these functions would be missing, the absolute value is also
$$\sqrt{x^2},$$ and the floor can even be emulated from $$\arctan(\tan(x))$$
but this is very inefficient and not completely accurate. 
A: Hint:
Since
$$|x|=\begin{cases}x\text{ if }x\ge 0\\-x\text{ if }x<0\end{cases}$$
Then
$$x+|x|=\begin{cases}x+x\text{ if }x\ge 0\\x-x\text{ if }x<0\end{cases}$$
