I\'ve tried searching for logarithm + objective-c, but all I get is math test pages from teachers, or explanations what a logarithm is ;)
I\'ve got some measurements
Also, getting a logarithm with an arbitrary base:
float logx(float value, float base)
{
return log10f(value) / log10f(base);
}
How about grabbing a book on C standard library functions?
Otherwise, you can try man pages:
man 3 logf
, for example
math.h is a standard include. the wikipedia page has some documentation.
Another way to 'squish' the values is to fit your values to a straight line. For you example:
Straight line equation
y = mx + c
y = 'squished' value.
x = The value you want to squish
m = Gradient of the line
c = intercept on the y axis
A quick calculation on your values gives something like:
y = 1.17e-3 x + 1.96
Hope this helps.