Adding check for zero to a negative power and throwing an exception in that event.