Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Exchange quadruple precision entities with C++

Pavel_Holoborodko__A
919 조회수

There is REAL*16 type for quadruple precision entities in Fortran. Is there similar type in Intel C++?

My ultimate goal is to use Fortran library relying on REAL*16 from C++ application. This means that I need equivalent quadruple precision type in both languages. Is there any?

Is it _Quad? If yes, is there any documentation about it? 

As a workaround, can I safely assume that REAL*16 can be represented in C++ by just two values of int64_t?

So that I can pass arguments to Fortran functions using something like struct{ int64_t a, int64_t b}

I would appreciate any help on this.

0 포인트
5 응답
Steven_L_Intel1
919 조회수
As far as I know, Intel C++ does not currently support the 128-bit floating type of Intel Fortran. If you simply want to pass it around, you can use any 16-byte container as long as you don't ask for it to be passed by value. (If you do, you'll run into problems on x64.)
0 포인트
Pavel_Holoborodko__A
919 조회수
Thank you Steve for your reply! One more related question. What is the internal format of REAL*16? Does it follow (or is it compatible with) IEEE 754-2008 standard (binary128)? 15 bits exponent, 113 mantissa and other properties? Knowing REAL*16 format I can create corresponding type in C++. Thank you in advance
0 포인트
Steven_L_Intel1
919 조회수
I've been informed that Intel C++ 13.0, as well as gcc 4.7, support the __float128 type and this is the same as Intel Fortran's REAL(16). It is the same as the IEEE 754-2008 128-bit floating type. Note that ISO_C_BINDING does not contain a definition for this type.
0 포인트
Pavel_Holoborodko__A
919 조회수
Thank you for reply. I use Intel(R) C++ Compiler XE 13.0 on Windows with MSVC 2010. It doesn't support __float128 type: "error : identifier "__float128" is undefined" . I guess it is supported only in Linux version of compiler? Or do I need some special tricks to enable it on Windows version of C++ (since Fortran already has it as REAL*16)?
0 포인트
Steven_L_Intel1
919 조회수
Sorry, it seems that its indeed Linux-only.
0 포인트
응답