Page 1 of 1

Logarithm function

Posted: Wed May 12, 2010 10:58 am
by Kumaran
how to implement logarithmic function in flow code v4,
i'm able to find the function in ARM,but its not available in PIC,
kindly suggest the equivalent methods for PIC,
i need to calculate log10 value of some expressions;
e.g. log10 (h)=?

Re: Logarithm function

Posted: Tue May 18, 2010 6:17 am
by Kumaran
pls suggest me some solution !

Re: Logarithm function

Posted: Tue May 18, 2010 8:55 am
by Benj
Hello,

There is no log function in BoostC as such so you cannot call it directly.

The best bet would be to use the look up table approach. Eg work out all the values of log that you will need for your program and store them all into an array. The Articles section of the forum has a good guide on creating look up tables.

Re: Logarithm function

Posted: Wed May 19, 2010 8:58 am
by Kumaran
as i wanted to make dew point calculation, the LOOK UP table approach is not suitable for my apllication.if you have any other method pls suggest me

Re: Logarithm function

Posted: Wed May 19, 2010 9:31 am
by Benj
The Hi Tech compiler support the log function. There are instructions for using Hi Tech with v4 of Flowcode in the articles section of the forums.

Otherwise I would use a AVR or an ARM as the GCC compiler handles floats and complex calculations quite well.

Re: Logarithm function

Posted: Wed May 19, 2010 11:27 am
by Kumaran
Thank you ! your suggesstion helps a lot