I'm looking for an efficient implementation of the function `pow(a, b)`

, where `a`

is limited to the interval `(0,1)`

, and `b`

is `>= 1`

(both are real numbers—i.e., not necessarily integers).

If it helps, `b`

is not a high number—let's say it is less than 10-20. That would open up the possibility of solving this problem iteratively, with a small number of iterations ~= `b`

The code should work on a 32-bit microcontroller, possibly without a floating-point unit (i.e., using a fixed-point implementation).

How can I implement such a function, optimized for the following constraints? I'm looking for the algorithm itself, so pseudocode is acceptable.

Read more here: https://stackoverflow.com/questions/64941736/efficient-implementation-of-fixed-point-power-pow-function-with-argument-const

### Content Attribution

This content was originally published by PSz at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.