0
$\begingroup$

Before I start this question, I am talking about calculating any calculatable power, with real numbers. EG: $2^{7.16}$

In the scripting language BATCH, you have access to only addition, substraction, multiplication, division, and mod.

Consider such a problem, where you are asked to calculate a power like the one above without using logarithms

Can you calculate something like $2^{7.16}$ with only these operations mentioned above? (or approximate it), or is it simply impossible?

$\endgroup$
0
$\begingroup$

Well, you could just write a function to approximate the logarithm via arithmetic operations. See here for how that is actually done.

$\endgroup$
0
$\begingroup$

Yes, of course you can approximate it. Wikipedia has a long article on how to compute roots.

Note that $\sqrt[n]{x}=y\implies y^n -x = 0$ so we can use a root finding algorithm to find arbitrary $n$th roots.

With that in hand, we can observe $2^{7.16} = 2^{716/100} = \sqrt[100]{2^{716}}$.

(There are often more efficient ways to calculate than this, but the simple method demonstrates that it's possible.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.