def decade_up(x, base=10):
 if (x == 0.0):
  return base
 lx = np.ceil((np.log(x) / np.log(base)))
 return (base ** lx)

def decade_up ( x , base = 10 ) : if ( x == 0.0 ) : return base lx = np . ceil ( ( np . log ( x ) / np . log ( base ) ) ) return ( base ** lx )
ceil x to the nearest higher decade .