FRDM-Kl25Z printf float question.

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

FRDM-Kl25Z printf float question.

跳至解决方案
1,658 次查看
larryo
Contributor II

I am working on a project using the FRDM-KL25Z  board and CW 10.6. I have the console I/O defined in PE but I cannot get printf() to work properly for a float. It works ok for an int, int a = 123; printf("%d\n",a); but not a double, double a = 1.234;  printf("%f\n",a); The result I get for the double is that %f is sent out the serial port.

 

If I set a break point the contents of the double is shown as the correct floating point result but it seems like the float specifier is handled as a string.

标签 (1)
0 项奖励
回复
1 解答
1,220 次查看
larryo
Contributor II

I found my problem. I did not have FP enabled in the Librarian

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,221 次查看
larryo
Contributor II

I found my problem. I did not have FP enabled in the Librarian

0 项奖励
回复