Andes Workshop

It is currently Fri Mar 29, 2024 1:50 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: 如何計算開根號的數學運算
PostPosted: Wed Oct 26, 2011 7:06 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
Q: 如何計算開根號的數學運算?我發現填常數可以,變數無法計算。
A:常數運算能work是因為compiler直接填結果在程式裡,並沒有帶進真正的function code。
除了程式裡要#include<math.h>之外,必須在linker裡加上-lm,
Andesight裡的參數是這樣子加:
Attachment:
p1.gif
p1.gif [ 17.07 KiB | Viewed 8208 times ]


Project上按右鍵-->Settings-->Andes C Linkers-->Libraries,右鍵按下Add…
Attachment:
p2.gif
p2.gif [ 6.58 KiB | Viewed 8208 times ]


然後打上m,按OK
Attachment:
p3.gif
p3.gif [ 5.33 KiB | Viewed 8208 times ]

就可以把-lm的參數加上去。


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group