Hi,
In my project I use CCSv4 (Version: 4.2.0.), and evaluation module TMDSEVM6457L.
The result of the operation printf() in code:
int i; float s=0.;
for(i=0;i<20;i++){
s+=log(i+1.);
printf("s=%lf\n",s);
}
is:
s=
s=0.62
s=1.72
s=
s=
s=6.11
s=
s=1s=)s=1s=1s=19.2
s=62.1
s=8s=;s=>s=3s=Bs=38.2
s=DDDR2
I do not understand why such the out of results to the console.
When I was trying to output results to the file, the results was not correct.
Code:
Uint32 *pDdr2Data = (Uint32 *)EMIFB_CE0_BASE_ADDR ;
ft=fopen("res.dat","w");
tempData = 0xdeadbeef;
for (index = 0; index < DATA_CNT; index++) {
pDdr2Data[index] = tempData;
fprintf(ft,"0x%llx\n", pDdr2Data[index]); }
fclose(ft);
Results:
0x7 b406ddeadbeef
0x 2b406ddeadbeef
0x„b406ddeadbeef
0x72b 40deadbeef
0x7 b406ddeadbeef
0x2b406ddeadbeef
0x„b406ddeadbeef
0x72b406ddeadbeef
0x7 b406ddeadbeef
0x 2b 40deadbeef
Please tell me how to display the results of HEX, float and double formats by the printf() /fprintf() function?