import itertools


def calculate_interval(num, start, step):
    """Calculate left border of interval for check.
    If step is 0 - raise ValueError.

    :param num: interesting value.
    :param start: left border of known interval.
    :param step: step of interval, positive number.
    :return: left border of interval.
    """

    if step == 0:
        raise ValueError("Step can't be 0!")

    if num == start:
        return num
    else:
        step = abs(step)
        step_direction = -1 if num < start else 1
        for x in itertools.count(start, step_direction * step):
            if x <= num < x + step:
                return x