Saturday 13 August 2016

exponentiation - Is there a way to calculate decimal powers using only addition, subtraction, multiplication and division?

I am a programmer who is trying to build an arbitrary precision decimal class library for C# and was successful in implementing all the basic operations like addition, subtraction, multiplication and division but was stopped when trying to calculate powers to decimal (and negative decimal) exponents. Calculating Log and Ln was also not possible since the depend on calculating powers.



So here is what I CAN do (with arbitrary accuracy):




  • Calculate the result of ALL operators if both numbers are integers.


  • Calculate the result of addition, subtraction, multiplication and division if the numbers are mixed (decimals and integers).


  • Calculate the result of the power of a decimal if the exponent is integer.





Here is what I CAN'T do (and I hope to find the answer here):




  • Calculate the power of decimals or integers to fractional, negative or decimal exponents.



Some (programmers) might point out that I can use functions already in C# to calculate these but this would not work as I need to build the library to be of arbitrary precision so I have to do the calculation manually.



So, is there a way to do it with the current "tools" I have? Iterative methods are not a problem since I will not be calculating the powers by hand, the CPU will be doing the counting.

No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...