0

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?

Offtkp
  • 153

2 Answers2

0

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.)

Xodarap
  • 6,115
0

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

pixel
  • 718