code: def eps_compare(f1, f2, eps):
      
      res = f1 - f2
      if abs(res) <= eps:  # '<=',so eps == 0 works as expected
          return 0
      elif res < 0:
          return -1
      return 1
docs: Return true if |f1-f2| <= eps.