# Exponential maths operator

I have written a math library which handles really big numbers with good precision. Each digit is stored in a nibble and a 'nibble array' makes up the number. There is no epsilon portion, as for currency calculation big brother is happy enough to loose penny fractions with int like rounding.

My problem is $a^b$ . It's all ok if $b$ is an integer value, but what if it has decimal digits.

But how to calculate $4.613765^{3.14259}$ from first principles. It's so long since I did a-level math I don't know where to begin.

How to calculate $a^b$ when $b$ is not an integer?

• Since both are rational numbers, you can write them on the form of $\frac{a}{b}^{\frac{n}{m}} = (\sqrt[m]{\frac{a}{b}})^n$. Or in your case, if you'd like to compute $4.6^{22/7}$, you can rewrite to $(\sqrt{4.6})^{22}$. Of course, I don't really know how to compute $\sqrt{4.6}$ exactly, so I'm not sure this is in the right direction ... – Pål GD May 3 '15 at 9:21
• @PålGD I can do sqrt by liner interpolation. What do operators prefix\ and a number in set brackets{ }. I'm guessing fraction is the digits after the decimal point. What's \$ about – rhubarbdog May 3 '15 at 9:51
• @rhubarbdog That's LaTeX; if you enable scripts here (and other SE sites), in particular those from mathjax.org, you'll see rendered mathematics. (Of course, the Android app can't do it; better use a browser for math-heavy SE sites.) – Raphael May 3 '15 at 9:55
• @PålGD's comment without the mathematical mark-up is: "Since both are rational numbers, you can write them in the form of (a/b)^(n/m) = (mth root of a/b)^n. Or in your case, if you'd like to compute 4.6^(22/7), you can rewrite to (7th root of 4.6)^22. Of course, I don't really know how to compute the seventh root of 4.6 exactly so I'm not sure this is in the right direction." – David Richerby May 3 '15 at 10:01
• @DavidRicherby I may have thrown a curved ball here. I want this to work for any a and any b. I should not have used a pi approximation as on of the terms, as for the other number (a) sorry if that also has 'magic' properties. – rhubarbdog May 3 '15 at 10:06