Math: simplified internal pow<n>() implementation.