Knuth's power tree: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed/added comments and whitespace, changed indentations, made other cosmetic changes.) |
m (added whitespace, split long sentences.) |
||
Line 1: | Line 1: | ||
{{draft task|Knuth's power tree}} |
{{draft task|Knuth's power tree}} |
||
( |
(Knuth's power tree is used for computing <big><big>x<sup>n</sup></big></big> efficiently using Knuth's power tree.) <br> |
||
;task requirements: |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Then, using those integers, calculate and show the exact (not approximate) value of (at least) the integer powers below: |
Then, using those integers, calculate and show the exact (not approximate) value of (at least) the integer powers below: |
||
Line 11: | Line 17: | ||
::* <big>3<sup>191</sup></big> |
::* <big>3<sup>191</sup></big> |
||
::* <big>1.1<sup>81</sup></big> |
::* <big>1.1<sup>81</sup></big> |
||
A zero power is often handled separately as a special case. |
A zero power is often handled separately as a special case. |
||
Optionally, support negative integers (for the power). |
Optionally, support negative integers (for the power). |
||
;example: |
|||
An example of a small power tree for some low integers: |
An example of a small power tree for some low integers: |
||
Line 72: | Line 82: | ||
See: link to Rosetta Code [http://rosettacode.org/wiki/Addition-chain_exponentiation addition-chain exponentiation]. |
See: link to Rosetta Code [http://rosettacode.org/wiki/Addition-chain_exponentiation addition-chain exponentiation]. |
||
<br> |
<br><br> |
||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |