def decade_down(x, base=10):
 lx = math.floor((math.log(x) / math.log(base)))
 return (base ** lx)

def decade_down ( x , base = 10 ) : lx = math . floor ( ( math . log ( x ) / math . log ( base ) ) ) return ( base ** lx )
floor x to the nearest lower decade .