- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I faced a strange problem. My program is running on MIC, and after I finished calculating an expression then assigned it to a variable, the problem cracked. The variable I assigned right now keeps zero and the assignment didn't work. The code looks like that:
wp[index] = p * w[l-1] printf("%f w:%f p:%f should be %f\n", wp[index],w[l-1],o,w[l-1]*p);
The output is strange, 'wp[index]' is zero but w[l-1]*p isn't. The final result is also zero, so I don't think it's only a block of print.
I also checked ASM code 'icpc' generate. It seems all right and the instruction 'movss' does really exist.
Does anyone have faced similar problems? I have no idea about it.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Depending on formatting, a tiny number may print as 0.0. Is this the case (tiny number).
Try printing out the hex (%x) of the values instead of float (%f). A true 0.0 will display as 0x0000
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page