GFORTRAN Quadruple Real Precision

**GFORTRAN_QUADMATH**
is a FORTRAN90 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.

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

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, FORTRAN90 programs which investigate the use of the Gnu GFORTRAN compiler with FORTRAN90 code.

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

REAL_PRECISION, FORTRAN90 programs 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;

- The Gnu FORTRAN page, http://www.gnu.org/software/fortran/fortran.html .
- The GFORTRAN Manual, http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gfortran.pdf.

- gfortran_quadmath.f90, a program that makes a simple test of the quadruple precision real arithmetic facility.
- gfortran_quadmath.sh, commands that compile and run the test;
- gfortran_quadmath_output.txt, the output file;

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