SPACING(3f)

DESCRIPTION
Determines the distance between the argument X and the nearest adjacent number of the same type.

STANDARD
Fortran 95 and later

CLASS
Elemental function

SYNTAX
RESULT = SPACING(X)

ARGUMENTS

X Shall be of type REAL.

RETURN VALUE
The result is of the same type as the input argument X.

EXAMPLE
          PROGRAM test_spacing
            INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
            INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)

            WRITE(*,*) spacing(1.0_SGL) ! "1.1920929E-07" on i686
            WRITE(*,*) spacing(1.0_DBL) ! "2.220446049250313E-016" on i686
          END PROGRAM

SEE ALSO
RRSPACING

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).