What if we wanted to make sure our input was positive before we used it in a function?
To our rescue comes the absolute value function. By dividing the number by its magnitude, we can determine its direction.
x∣x∣⇒{+→1,−→−1} If positive, we'll get 1, and if negative, we will get −1.
Now, we need to configure the positive-negative function to output binary, so that we can use it as a building block later. This means outputting 1 if it is positive, and 0 if it is negative.
isPositive(x)=x∣x∣+1⇒{+→2,−→0} isPositive(x−y)=2x∣x∣+1⇒{+→1,−→0} Success!