Hi, This is probably more of a maths question than a programming question, but how do I do log mathematics without a log function?
I want to write a function to convert pressure to altitude, the formula I found (after a lot of searching) includes log maths, is there a way of doing this without a log function?
The function can be seen here (it's the 2nd function on the page)....
Most of it seems pretty simple, but how do I get around the log bit?
It would depend on the accuracy. You could do a look up table for a range of values from 0..1. The better the accuracy, the more values in the table. This type of look up table is used a lot for trig functions.
And if you have to resort to a lookup table, remember to use the progmem/flash RAM to store it, not SRAM. However, I would check out math.h first. Potentially a quicker way to get the job done.