log function - MC9S08AW60

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

log function - MC9S08AW60

Jump to solution
1,572 Views
syediftekharhas
Contributor I
hi,
i m using log10() function, and using MC9S08AW60 microcontroller and codewarrior complier .
suppose my program is this:
 
char x,y,z
float n;
main(){
 
x=x+1;
y=y+1;
z=z+1;
n=log10f(2.00);
 
}
 
after calculate log, all global variables are to be zero.
 
 
Added p/n to subject.
 


Message Edited by NLFSJ on 2008-02-28 06:13 AM
Labels (1)
Tags (1)
0 Kudos
1 Solution
487 Views
CompilerGuru
NXP Employee
NXP Employee
You should not return from main, or what to you expect to happen then. Add for example an endless loop at the end.
Also make sure you application has enough stack space, not sure how much log10 needs.
And finally a comment states that all globals should be zero, well given the code I would not expect any of them to be zero actually.

Daniel

View solution in original post

0 Kudos
2 Replies
488 Views
CompilerGuru
NXP Employee
NXP Employee
You should not return from main, or what to you expect to happen then. Add for example an endless loop at the end.
Also make sure you application has enough stack space, not sure how much log10 needs.
And finally a comment states that all globals should be zero, well given the code I would not expect any of them to be zero actually.

Daniel
0 Kudos
487 Views
CrasyCat
Specialist III
Hello
 
  Did you include math.h in the source file where you did use log10f?
  Did you specify you want to use floating point arithmetic when you have created your project?
 
  With which ansi library file are you linking your application?
 
CrasyCat