Ask Your Question

Revision history [back]

def Ns(x, nd = 5): # round x to a given number of significant digits d = ceil(log(abs(x), 10)) return round(x, ndigits = -d + nd)

def Ns(x, nd = 5):
        # round x to a given number of significant digits 
        d = ceil(log(abs(x), 10))
        return round(x, ndigits = -d + nd)

nd)