def changed(old,new,delta,relative=True):
    """ Tests if a number changed significantly
    -) delta is the maximum change allowed    
    -) relative decides if the delta given indicates relative changes (if True) or absolute change (if False)
    """
    delta = abs(delta)
    epsilon = 1.0
    
    if old > epsilon:
        if relative:
            notChanged = (new <= (1+delta)*old) and (new >= (1-delta)*old) 
        else:
            notChanged = (new <= old+delta) and (new >= old-delta)             
    elif old < -epsilon:
        if relative:
            notChanged = (new >= (1+delta)*old) and (new <= (1-delta)*old) 
        else:
            notChanged = (new >= old-delta) and (new <= old+delta)             
    else:
        notChanged = (new >= old-epsilon) and (new <= epsilon+old)         
    return not notChanged