log function - MC9S08AW60

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

log function - MC9S08AW60

ソリューションへジャンプ
2,252件の閲覧回数
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,167件の閲覧回数
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,168件の閲覧回数
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,167件の閲覧回数
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