Main

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

AR# 29787

Search For Another Answer

Topic EDK-Libraries
Last Updated 04/23/2009
Status Active
Description

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?

Solution

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.


 
 
/csi/footer.htm