On-Line Evaluation of Powers Using Euclid's Algorithm