def sign(x):
    """
       Objective: take the sign of x
       e.g.,
          >>>sign(-1.2)
          -1
          >>>sign(5)
          1
    """
    if x>0: return 1
    elif x<0: return -1
    else: return 0