def nearly_equal(a,b,sig_fig=5):
    """
    Returns it two numbers are nearly equal within sig_fig decimal places

http://stackoverflow.com/questions/558216/function-to-determine-if-two-numbers-are-nearly-equal-when-rounded-to-n-signific

    :param flt a: number 1
    :param flt b: number 2
    :param int sig_fig: number of decimal places to check agreement to

    :returns bool:    
    """

    return ( a==b or 
             int(a*10**sig_fig) == int(b*10**sig_fig)
           )