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 agoHi,
I have the problem that the floating point numbers are always printed as -ÿÿÿ.ÿÿÿÿÿÿ on the console window :( My code is, where f[z] is an array of floats f[z] = 2.0*f[z]/(412.0) - 1.0; f[z] = f[z] * 1024.0; printf ("\n %0f", (float)f[z]); the printf prints all other formats correctly like integers and chars ... thanks