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.

Multiprecision Computing Toolbox for MATLAB
6 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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

Steve - Intel Developer Support

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

Multiprecision Computing Toolbox for MATLAB

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.

Steve - Intel Developer Support

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

Multiprecision Computing Toolbox for MATLAB

Sorry, it seems that its indeed Linux-only.

Steve - Intel Developer Support

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui