# Thread: Expressing A Piece Wise Function

1. ## Expressing A Piece Wise Function

I'm stuck on a problem. I'm given the ramp function defined as ramp(x) = x if x is greater or = 0 or 0 if x is less than 0. I need to express this function in one line using the absolute value function. How would I do this? Please guide me through the logic.

Help is appreciated!

2. ## Re: Expressing A Piece Wise Function

Originally Posted by Manni
I'm stuck on a problem. I'm given the ramp function defined as ramp(x) = x if x is greater or = 0 or 0 if x is less than 0. I need to express this function in one line using the absolute value function. How would I do this? Please guide me through the logic.
If the function is $\text{ramp}(x) = \left\{ \begin{gathered} x,\;x \geqslant 0 \hfill \\ 0,\;x < 0 \hfill \\ \end{gathered} \right$
then $\text{ramp}(x)=\frac{x+|x|}{2}$.