When you get a divison by zero error/ exception it boils down to a rounding issue and how numbers are technically handled (machine representation of numbers). It depends how you calculate the number e (i.e. a by an approximation function) and it depends how you exponentiate. For exponentiation and calculating roots (nth root) there exists approximation functions that contain divisions. So rounding is the main culprit here.
That's the difference between theory and concrete implementation.