CW10.4 printf float number?

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

CW10.4 printf float number?

跳至解决方案
1,315 次查看
danielchai
Senior Contributor I

Hi,

I am using CW10.4, k60N512. Now I am trying to print a float number using

printf("Float number is %f\n", fnum);

but it prints"Float number is f".

I read some and configure MQX_INCLUDE_FLOATING_POINT_IO  to 1 in smallest_config.h which is included by user_config.h, but it still prints the same content.

I tried to include <stdio.h>, but it give me many errors after I including it in my project.

Is there anything  I miss or configure wrong?

Thanks.

-Daniel

0 项奖励
回复
1 解答
1,029 次查看
dereksnell
NXP Employee
NXP Employee

Hi Daniel,

Try defining MQX_INCLUDE_FLOATING_POINT_IO as 1 in user_config.h.  Then rebuild the PSP.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,030 次查看
dereksnell
NXP Employee
NXP Employee

Hi Daniel,

Try defining MQX_INCLUDE_FLOATING_POINT_IO as 1 in user_config.h.  Then rebuild the PSP.

0 项奖励
回复
1,029 次查看
danielchai
Senior Contributor I

Derek,

Thanks. It works.

0 项奖励
回复