log equation to simplifed for microcontroller

Status
Not open for further replies.

pany2008

Junior Member level 3
Joined
Aug 24, 2009
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
India
Activity points
1,627
Hi,

I want the programming code for following equation
logb(x) :- b(base) will be 10 fixed and x will vary from 0 to 1000,
i want the log result of x, where the result i want in 3 decimal point example log(500) = 2.698, x is my adc count from 0 to 1000.
If any one can help me out for the code for pic microcontroller(pic16f877a) i am using the hitech complier.
 

yes it returns the float value.
if you want to avoid the trailing numbers after the point you can use round() function...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…