log function - MC9S08AW60

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

log function - MC9S08AW60

跳至解决方案
2,249 次查看
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
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,164 次查看
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 项奖励
回复
2 回复数
1,165 次查看
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 项奖励
回复
1,164 次查看
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