def rounded_down (value, granularity) :
    """Returns `value` rounded down to nearest multiple of `granularity`.

       >>> rounded_down (3, 5)
       0
       >>> rounded_down (8, 5)
       5
       >>> rounded_down (5, 5)
       5
       >>> rounded_down (-3, 5)
       -5
       >>> rounded_down (-8, 5)
       -10

       >>> rounded_down (0.97, 0.01)
       0.97
       >>> rounded_down (0.971, 0.01)
       0.97
       >>> rounded_down (0.9699999999, 0.01)
       0.96
       >>> rounded_down (0.9799999999, 0.01)
       0.97
       >>> rounded_down (0.97, 0.05)
       0.95
       >>> rounded_down (-0.97, 0.01)
       -0.97
       >>> rounded_down (-0.971, 0.01)
       -0.98
       >>> rounded_down (-0.9699999999, 0.01)
       -0.97
       >>> rounded_down (-0.9799999999, 0.01)
       -0.98
       >>> rounded_down (-0.97, 0.05)
       -1.0

    """
    if 0 < granularity < 1 :
        scale  = 1.0 / granularity
        result = rounded_down (value * scale, 1.0) / scale
    else :
        result = value - (value % granularity)
    return result