We consider a general problem of inelastic collision of particles interacting with power-law potentials. Using quantum-defect theory we derive an analytical formula for the energy-dependent complex scattering length, valid for arbitrary collision energy, and use it to analyze the elastic and reactive collision rates. Our theory is applicable for both universal and nonuniversal collisions. The former corresponds to the unit reaction probability at short range, while in the latter case the reaction probability is smaller than one. In the high-energy limit we present a method that allows us to incorporate quantum corrections to the classical reaction rate due to the shape resonances and the quantum tunneling.