import math


def get_relative_index(value, min_value, step):
    """ Returning the relative bin index of a value given bin start and bin span.

    Args:
        value: The value to be converted to index.
        min_value: The minimum value of a value series.
        step: The span of the bin.
    """
    assert value >= min_value
    assert step > 0
    return math.floor((value - min_value) / step)