Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Avisos
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discusiones

print float type

NOHWJ
Principiante
1.190 Vistas

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 Respuestas
NOHWJ
Principiante
1.188 Vistas

I executed that  on Nios ii SW 

Hazlina_R_Intel
Moderador
1.156 Vistas

Hi,

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


-Hazlina


Hazlina_R_Intel
Moderador
1.156 Vistas

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.


EricMunYew_C_Intel
Moderador
1.128 Vistas

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


Responder