intro_quad_precision - Introduction to Cray C/C++ and Fortran Compiler 128-bit intrinsics



The following generic functions accept quad-precision arguments and return quad-precision real or complex results, unless noted otherwise. Also see the generic man page for each function.

       Generic Quad-precision Fortran Functions
generic                   arg            result
ABS                       real/complex   real/complex
ACOS                      real/complex   real/complex
ACOSH                     real/complex   real/complex
AIMAG                     complex        real
AINT                      real           real
ANINT                     real           real
ASIN                      real/complex   real/complex
ASINH                     real/complex   real/complex
ATAN                      real           real
ATAN2                     real           real
BESSEL_J0                 real           real
BESSEL_J1                 real           real
BESSEL_JN                 real           real
BESSEL_Y0                 real           real
BESSEL_Y1                 real           real
BESSEL_YN                 real           real
CEILING                   real           real
CMPLX                     real           complex
CONJG                     complex        complex
COS                       real/complex   real/complex
COSH                      real/complex   real/complex
DBLE                      real           real
DIM                       real           real
DPROD                     real           real
ERF                       real           real
ERFC                      real           real
ERFC_SCALED               real           real
EXP                       real/complex   real/complex
EXPONENT                  real           real
FLOOR                     real           real
FRACTION                  real           real
GAMMA                     real           real
HYPOT                     real           real
IEEE_CLASS                real           constant
IEEE_COPY_SIGN            real           real
IEEE_IS_FINITE            real           logical
IEEE_IS_NAN               real           logical
IEEE_IS_NEGATIVE          real           logical
IEEE_IS_NORMAL            real           logical
IEEE_LOGB                 real           real
IEEE_NEXT_AFTER           real           real
IEEE_REM                  real           real
IEEE_RINT                 real           real
IEEE_SCALB                real           real
IEEE_UNORDERED            real           logical
INT                       real           integer
LOG                       real/complex   real/complex
LOG_GAMMA                 real           real
LOG10                     real           real
MAX                       real           real
MIN                       real           real
MOD                       real           real
MODULO                    real           real
NEAREST                   real           real
NINT                      real           integer
NORM2                     real           real
REAL                      real           real
RRSPACING                 real           real
SCALE                     real           real
SET_EXPONENT              real, integer  real
SIGN                      real           real
SIN                       real/complex   real/complex
SINH                      real/complex   real/complex
SQRT                      real/complex   real/complex
TAN                       real/complex   real/complex
TANH                      real/complex   real/complex

C Synopsis

#include <quadmath.h>    /* definition for 128-bit functions */
#include <complex.h>     /* additional definition required for complex functions */
              Quad-precision C/C++ real functions
Usage                                                     function
__float128 acosq(__float128 x);                           acos
__float128 acoshq(__float128 x);                          acosh
__float128 asinq(__float128 x);                           asin
__float128 asinhq(__float128 x);                          asinh
__float128 atanq(__float128 x);                           atan
__float128 atan2q(__float128 x, __float128 y);            atan2
__float128 atanhq(__float128 x);                          atanh
__float128 coshq(__float128 x);                           cosh
__float128 cbrtq(__float128 x);                           cbrt
__float128 copysignq(__float128 x);                       copysign
__float128 erfq (__float128 x);                           erf
__float128 erfcq (__float128 x);                          erfc
__float128 expq(__float128 x);                            exp
__float128 exp2q(__float128 x);                           exp2
__float128 expm1q(__float128 x);                          exp1m
__float128 fabsq(__float128 x);                           fabs
__float128 fdimq (__float128 x, __float128 y);            fdim
int fegetroundq(__float128 x);                            fegetround
int fesetroundq(__float128 x);                            fesetround
__float128 floorq(__float128 x);                          floor
__float128 fmaq(__float128 x, __float128 y, __float128 z);fma
int fpclassifyq(__float128 x);                            fpclassify
__float128 frexpq(__float128 x, int * y);                 frexp
__float128 hypotq(__float128 x);                          hypot
int isinfq(__float128 x);                                 isinf
int isnanq(__float128 x);                                 isnan
int isnormalq(__float128 x);                              isnormal
int isfiniteq(__float128 x);                              isfinite
int isgreaterq(__float128 x);                             isgreater
int isgreaterequalq(__float128 x);                        isgreaterequal
int islessq(__float128 x);                                isless
int islessequalq(__float128 x);                           islessequal
int islessgreaterq(__float128 x);                         islessgreater
__float128 ilogbq(__float128 x);                          ilogb
int isunorderedq(__float128 x);                           isunordered
__float128 j0q(__float128 x);                             j0
__float128 j1q(__float128 x);                             j1
__float128 jnq(int x, __float128 y);                      jn
__float128 ldexpq(__float128 x, int y);                   ldexp
__float128 logbq(__float128 x);                           logb
long int lrintq(__float128 x);                            lrint
long long int llrintq(__float128 x);                      llrint
long int lroundq(__float128 x);                           lround
long long int llroundq(__float128 x);                     llround
__float128 log1pq(__float128 x);                          log1p
__float128 log2q(__float128 x);                           log2
__float128 modfq(__float128 x);                           modf
__float128 nearbyq(__float128 x);                         nearby
__float128 nextafterq(__float128 x, __float128 y);        nextafter
__float128 nexttowardq(__float128 x, __float128 y);       nexttoward
__float128 powq(__float128 x, __float128 y);              pow
__float128 remainderq(__float128 x, __float128 y);        remainder
__float128 remquoq(__float128 x, __float128 y, int *z);   remquo
__float128 rintq(__float128 x);                           rint
__float128 roundq(__float128 x);                          round
__float128 scalbnq(__float128 x);                         scalbn
__float128 sinq(__float128 x);                            sin
__float128 sinhq(__float128 x);                           sinh
__float128 sqrtq(__float128 x);                           sqrt
__float128 tanq(__float128 x);                            tan
__float128 tanhq(__float128 x);                           tanh
__float128 tgammaq(__float128 x);                         tgamma
__float128 tgammaq(__float128 x);                         tgamma
__float128 truncq(__float128 x);                          trunc
__float128 y0q(__float128 x);                             y0
__float128 y1q(__float128 x);                             y1
__float128 ynq(int x, __float128 y);                      yn
               Quad-precision complex functions
Usage                                                     function
__float128 complex cabsq(__float128 complex x);           cabs
__float128 complex cacosq(__float128 complex x);          cacos
__float128 complex cacoshq(__float128 complex x);         cacosh
__float128 complex casinq(__float128 complex x);          casin
__float128 complex casinhq(__float128 complex x);         casinh
__float128 complex catanq(__float128 complex x);          catan
__float128 complex catanhq(__float128 complex x);         catanh
__float128 complex ccosq(__float128 complex x);           ccos
__float128 complex ccoshq(__float128 complex x);          ccosh
__float128 complex cexpq(__float128 complex x);           cexp
__float128 complex cimagq(__float128 complex x);          cimag
__float128 complex conjq(__float128 complex x);           conj
__float128 complex cpowq(__float128 complex x, __float128 cpow
complex y);
__float128 complex crealq(__float128 complex x);          creal
__float128 complex csinq(__float128 complex x);           csin
__float128 complex csinhq(__float128 complex x);          csinh
__float128 complex csqrtq(__float128 complex x);          csqrt
__float128 complex ctanq(__float128 complex x);           ctan
__float128 complex ctanhq(__float128 complex x);          ctanh


Cray Linux Environment (CLE): supported on Cray CNL compute nodes


The Cray C/C++ and Fortran Compilers support 128-bit floating point and 256-bit complex predefined types using the X86-64 ABI definitions for type names and data layout. These types are sometimes referred to as “quad-precision”. In Fortran, use real(kind=16) and complex(kind=16) to declare variables of these types. In C and C++, use __float128, and __float128 complex.

The base type itself uses 128 bits of storage with a guaranteed minimum alignment on a 128-bit boundary, little endian, has a 15-bit exponent, a 113-bit mantissa, and an exponent bias of 16383, and is compatible with the gcc implementation.

Please refer to the generic or related function’s man page for more information.


Cray C and C++ Reference Manual

Cray Fortran Reference Manual