gfortran_quadmath_test, a Fortran90 code which illustrates the use of quadruple real precision arithmetic with the Gnu Fortran compiler.

Every Fortran compiler offers a default real datatype as well as a double precision real data type.

Starting with Fortran90, it become possible to describe these types in terms of a KIND parameter. The actual values of the KIND parameter corresponding to particular types was left up to the compiler writer. For gfortran, real and double precision variables can be declared with KIND values of 4 and 8 respectively:

REAL ( KIND = 4 ) W
REAL ( KIND = 8 ) X

On some systems, the gfortran compiler provides a real data type stored in 80 bytes, specified by a KIND value of 10, and on some systems, a data type stored in 128 bytes, with a KIND of 128. Variable declarations would be

REAL ( KIND = 10 ) Y
REAL ( KIND = 16 ) Z

The Macintosh OSX system I have access to seems to have the KIND = 10 option, but not the KIND = 16 option.


The information on this web page is distributed under the MIT license.


gfortran_quadmath_test is available in a C version and a C++ version and a Fortran90 version.

Related Data and Programs:

gfortran_test, Fortran90 codes which investigate the use of the Gnu gfortran compiler with Fortran90 code.

gfortran_intrinsics_test is a Fortran90 code which illustrates the use of intrinsic functions provided by the Gnu gfortran compiler for Fortran90.

real_precision, Fortran90 codes which investigate the somewhat awkward methods for requesting a real data type with given precision. This is the preferred method for requesting double or quadruple precision arithmetic;


  1. The Gnu Fortran page, .
  2. The gfortran Manual,

Source code:

Last revised on 11 July 2020.