Is there a function which returns $1$ if we give it a positive number and $0$ if we give it a negative number? For example:
$f(-6.3) = 0$
And
$f(6.3) = 1$
Thanks in advance for your answers.
Is there a function which returns $1$ if we give it a positive number and $0$ if we give it a negative number? For example:
$f(-6.3) = 0$
And
$f(6.3) = 1$
Thanks in advance for your answers.
If you would like an equation for the unit step function you could use this:
$$ U(x)=\frac{1}{2}\left(1+\frac{\vert x\vert}{x}\right)$$
This version is undefined for $x=0$.
We can have $$f (x) = \begin {cases} 1; x > 0 \\ 0 ; x <0\end {cases} $$
Hope it helps.
Yes, step function (https://en.m.wikipedia.org/wiki/Step_function).
$ f(x) = 1 $ for $x \geq 0$ and $0$ otherwise.