^

AR# 29787 11.1 EDK - How to properly print the floating point number in C code

Keywords: print, printf, stack, heap, floating, point

I am using EDK and an ML505 board. I use the following printf() function to print a floating point number:
printf("0.0009765625 = %.9f\r\n", 0.0009765625);

The output on the Terminal is as follows:
0.0009765625 = 0.00112

How do I correct the problem?

To solve the above problem, you need to increase the heap size. A value of 0x800 has been seen to work.

To use the printf() function, you need also to make sure that the stack size is set to at least 0x2000.


AR# 29787
Date Created 04/20/2009
Last Updated 04/23/2009
Status Active
Type
Feed Back