Well, apparently I'm still in mathematical mode. This is a function which raises a base to an exponent, i.e, Power(base,exponent) and might make a good addition to the Maths.H include file.
I had originally thought Legendre's method would be more efficient, but decided the IF/THEN's added too much overhead given that we're working with small numbers on a microcontroller. And this simpler version has the advantage of using very little program space.
So, here's a demo, from which the function may be extracted if it meets the needs of this community.
Well, apparently I'm still in mathematical mode. This is a function which raises a base to an exponent, i.e, Power(base,exponent) and might make a good addition to the Maths.H include file.
I had originally thought Legendre's method would be more efficient, but decided the IF/THEN's added too much overhead given that we're working with small numbers on a microcontroller. And this simpler version has the advantage of using very little program space.
So, here's a demo, from which the function may be extracted if it meets the needs of this community.
Last edit: Anonymous 2014-05-02