4 ms·
After you calc X^Y, when you will calc X^(Y+1), doesn't it worth to calc using the previous result (X^Y)*X instead of another power X^(Y+1) ?
by lmcarreiro 8y ago
After you calc X^Y, when you will calc X^(Y+1), doesn't it worth to calc using the previous result (X^Y)*X instead of another power X^(Y+1) ?
- deleted 8y ago[deleted]
- kazinator 8y agoYou will find here that the run-time is swamped by the digit breakdown and summing, so that exponentiation versus accumulated product doesn't make a palpable difference.