Is there an equation, that will return either 1 if a variable is positive, or 0 if the variable is negative.
For example, to see if an integer is odd or even you can use:
$$r=\frac{(-1)^n+1}{2}$$
where $r$ will be $1$ if $n$ is even, and $r$ will be $0$ if $n$ is odd.
So is there a similar equation, to see if $n$ is positive or negative?
(sorry I have no idea what to tag this)
TRUEas 1 andFALSEas 0. But really, @Jonathan, just think of $[x > 0]$ as really compressed shorthand for "1 if $x$ is greater than zero (positive), and 0 otherwise." – J. M. ain't a mathematician Oct 19 '11 at 00:20