FRDM-Kl25Z printf float question.

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

FRDM-Kl25Z printf float question.

ソリューションへジャンプ
1,713件の閲覧回数
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,275件の閲覧回数
larryo
Contributor II

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

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,276件の閲覧回数
larryo
Contributor II

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

0 件の賞賛
返信