Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.

print float type

NOHWJ
Beginner
550 Views

Hi,

I'm trying to print float type data like this.

-----------------------

#include <stdio.h>

float data=0.123;

printf("%f",data);

----------------------

but, it shows empty in console display. No syntax ,build error before Run.

i tried %e , %g  and it also showed same results.

for integer type, it works. so i don't know how to solve.

0 Kudos
4 Replies
NOHWJ
Beginner
548 Views

I executed that  on Nios ii SW 

0 Kudos
Hazlina_R_Intel
Moderator
516 Views

Hi,

May I understand what computer program are you trying to run this code in? Thanks.


-Hazlina


0 Kudos
Hazlina_R_Intel
Moderator
516 Views

Just saw your other post saying that you are trying to run this in Nios tool.

Ignore my question.

I will assign this to Nios engineer.


0 Kudos
EricMunYew_C_Intel
Moderator
488 Views

can you try printf("%.3f",data);


0 Kudos
Reply