The function alternates between returning -1 and 1 based on the sign of the input value. 
