GFORTRAN Quadruple Real Precision

GFORTRAN_QUADMATH is a FORTRAN77 program which illustrates the use of quadruple real precision arithmetic with the Gnu GFORTRAN FORTRAN compiler.

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

Development of the FORTRAN77 language ceased on the release of the FORTRAN90 standard. However, some features of the newer versions of FORTRAN have "crept into" the older language and are accepted, at least by some compilers. Thus, the GFORTRAN compiler will allow FORTRAN77 code to declare single and double precision real variables with a syntax that mimics that it allows in FORTRAN90 code:

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

On some systems, the GFORTRAN compiler also 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 that GFORTRAN may accept 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 computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


Versions of the QUADMATH examples are available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version.

Related Data and Programs:

G95_QUADMATH, a FORTRAN90 program which illustrates the use of quadruple precision real arithmetic provided on some systems by the G95 compiler for FORTRAN.

GFORTRAN, FORTRAN77 programs which investigate the use of the Gnu GFORTRAN compiler for FORTRAN77.

GFORTRAN_INTRINSICS, a FORTRAN77 program which illustrates the use of intrinsic functions provided by the Gnu GFORTRAN compiler for FORTRAN77.


  1. The Gnu FORTRAN page, .
  2. The GFORTRAN Manual,

Examples and Tests:

You can go up one level to the FORTRAN77 source codes.

Last revised on 19 April 2011.