Complete the given method and return:
-2 if x is negative infinity
2 if x is positive infinity
1 if x is not a number
0 otherwise