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 ago...what gabrigob wrote... It's a type issue that you're hitting here. I'd play around with that until you get it to work.
Note that it is _definitely_ possible. I was the maintainer of the software for a 10g design (https://www.altera.com/support/software/download/refdesigns/ip/interface/dnl-10gbe-hardware-demo.jsp), for a bit, and did just this successfully in order to display the massive numbers related to packet-based stats. Also, I wasn't aware that the %lf was valid. I'm pretty sure the length modifier is only valid when printing integer values. Regards, slacker