def define_interval(weight, eps, method):
    """
    :param weight: element weight
    :param eps: measurement error
    :param method: method for interval construction (0 - error is absolute, 1 - error is relative)
    :return: interval value
    """
    if method == 0:
        return weight - eps, weight + eps
    else:
        return weight * (1 - eps), weight * (1 + eps)