We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 21342

7.1 EDK-GNU - mb-gcc issues with fprintf and floating point values


Keywords: EDK, XPS, GNU, MB-GCC, printf, float, double

Urgency: Standard

General Description:
The mb-gcc compiler exhibits strange behavior for fprintf when printing floating point numbers. The following example illustrates this behavior:

float af = -3.14;//-45.0*DEG_TO_RAD;
double ad = -3.14;//-45.0*DEG_TO_RAD;

fprintf(stdout, "1.0 = %f\n\r", 1.0);
printf("1.0 = %f\n\n\r", 1.0);

The output is as follows:

1.0 = 0
1.0 = 1.000000


This problem has been fixed in the latest EDK 7.1i Service Pack available at:
The first service pack containing the fix is EDK 7.1i Service Pack 1.
AR# 21342
日期 04/13/2007
状态 Archive
Type 综合文章