CW10.4 printf float number?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW10.4 printf float number?

Jump to solution
1,303 Views
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 Kudos
Reply
1 Solution
1,017 Views
dereksnell
NXP Employee
NXP Employee

Hi Daniel,

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

View solution in original post

0 Kudos
Reply
2 Replies
1,018 Views
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 Kudos
Reply
1,017 Views
danielchai
Senior Contributor I

Derek,

Thanks. It works.

0 Kudos
Reply