def tolerance(a, b, e):
    """Return if a-b is within tolerance e"""
    d = a - b
    if d < 0:
        d = -d
    if a != 0:
        e = e * a
        if e < 0:
            e = -e
    return d <= e