Gday Dampf
For logarithms
log(1/n) = - log(n)
log(x/y) = log(x)-log(y)
therefore ( assuming x and y stay integers ) you can rewrite
result = log10(1/x) - log10(1/y) to use integers only
using above relationships you get the following
result = log10(y/x)
and hence
result = log10(y) - log10(x) <-use this instead as easier to calc
I found a nice way to calc logs in base2 which you then convert to baseE / base10 etc as you choose by using a std conversion factor. If you read the "logarithm by calculation" section from
http://www.emesys.com/BS2math3.htm it explains it very well and gives a BS2 code example that you can modify to suit PBP fairly easily.
It has a small footprint and appears to work quite well.
May help you out
Andrew
Bookmarks