Forum Discussion
Altera_Forum
Honored Contributor
17 years agoHow to show float on console?
I want to print float on console.
In code : double a; printf("the num is %f/n",a); but ,in nios the result is: the num is no float!who can help me ?2 Replies
- Altera_Forum
Honored Contributor
isn't %f for floats only? I believe you need %lf to print a double.
- Altera_Forum
Honored Contributor
If you are using the small newlib c library, it has not float support with printf() by specification.