Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

hexadecimal floating point constant question

Intel_C_Intel
Employee
269 Views

I'm using Intel C++ 10.1.014 (IA-32) with VS2005 trying to compile the following code:

const float twoTo23 = 0x1.0p23f;

What I get is 'error: expected a ";"' on that line. I've tried many variations (non-hex works fine) and a few compiler switches(/Qstd=c99, /Qstd=c++0x, /Qc99) with the same results. I've verified that the compiler output is from Intel (not MSVC) and have looked at other switches.

The file being compiled ends with .cxx and includes a .h file with the above code in it, if that helps. According to an old post in this forum, and in the Intel compiler specs, hex floating-point constants are supposed to be supported. Am I missing a switch or some other details? Please help.

Thanksall,

-Allen

0 Kudos
2 Replies
TimP
Honored Contributor III
269 Views
c99 isn't compatible with C++, which is set by the .cxx suffix.
0 Kudos
Intel_C_Intel
Employee
269 Views
So, are you saying that hex floating-point constants are not supported in C++ files compiled by icc (with or without /Qstd=c++0x), but only in c99 .c files?

If so, that might make sense why I can't get it to compile; however, it would kind of put a damper in my day. The source code I am trying to compile works in XCode, Linux gcc, and Borland (although, not MSVC).
0 Kudos
Reply