What kind of logarithm functions / methods are available in objective-c / cocoa-touch?

≡放荡痞女 提交于 2019-11-28 01:52:53

Also, getting a logarithm with an arbitrary base:

float logx(float value, float base) 
{
   return log10f(value) / log10f(base);
}

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.

How about grabbing a book on C standard library functions?

Otherwise, you can try man pages: man 3 logf, for example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!