I was looking for a simple function that converts an integer in the following way:
If x < 0, f(x) = -1 If x = 0, f(x) = 0 If x > 0, f(x) = 1
Is there a simple function that does this?
Edit: Sorry for the confusion of the word "simple" Perhaps I should have said a function that does not involve 'if logic' (bear with me, i'm not a mathmagician) but is within reason to replace the existing 'if logic' because it is not a large formula.