def METHOD_NAME():
    assert modular_range_bidirectional(5, range(10)) == 5
    assert abs(modular_range_bidirectional(5.1, range(10)) - 5.1) < 1e-6
    assert modular_range_bidirectional(11, range(10)) == 2
    assert abs(modular_range_bidirectional(11.3, range(10)) - 2.3) < 1e-6
    assert modular_range_bidirectional(-7, range(10)) == -7
    assert abs(modular_range_bidirectional(-7.1, range(10)) - (-7.1)) < 1e-6
    assert abs(modular_range_bidirectional(-13.2, range(10)) - (-4.2)) < 1e-6