Exchange quadruple precision entities with C++

Exchange quadruple precision entities with C++

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.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.)

Retired 12/31/2016

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

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.

Retired 12/31/2016

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)?

Sorry, it seems that its indeed Linux-only.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today