Forum Discussion
Altera_Forum
Honored Contributor
15 years agoprinting floating point
Hi, is there any ways to print float number in Nios II? Example: a = 100, b = 195 c = (b-a)/100, so c = 0.95 so, how to print c = 0.95? because when i print, the answer is 0.
Altera_Forum
Honored Contributor
15 years agoportion of my code:
--- Quote Start --- dma_tick = (unsigned int)(end_dma - start_dma); pio_tick = (unsigned int)(end_pio - start_pio); freq = (unsigned int)(alt_timestamp_freq()); improve = (((pio_tick - dma_tick)/pio_tick) *100); printf("Printing report..\n\n"); printf("******* System Performance Analysis *******\n"); printf("Data size tested : %d Bytes\n", (length*4)); printf("Number of ticks per second : %u\n", freq); printf("Without DMA: Number of ticks: %u\n", pio_tick); printf("DMA: Number of ticks : %u\n", dma_tick); printf("* System Performance Improvement: %lf\n", improve); --- Quote End --- i cant print improve... i am using full lib, not small or reduced..