Quote:
Or indeed rational powers ;-) But I think the exercise would be looking primarily for the naturals. I agree the method is sound, although I think you're better treating the 0 case as the end case.
I agree 100%, which is why I personally don't believe this is a good exercise to demonstrate the usefulness of recursion, since (ideally) too many conditions must be checked for within the recursive function. But then again, I haven't written any C++ books, so who am I to judge :)