[UP]


Manual Reference Pages  - spacing (3)

NAME

spacing(3f) - [FORTRAN:INTRINSIC:MODEL_COMPONENTS] Smallest distance between two numbers of a given type

CONTENTS

Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also

SYNTAX

result = spacing(x)

DESCRIPTION

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

ARGUMENTS

X - Shall be of type REAL.

RETURN VALUE

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

EXAMPLE

Sample program:

    program demo_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 demo_spacing

STANDARD

[[Fortran 95]] and later

CLASS

Elemental function

SEE ALSO

[[rrspacing]]


spacing (3) March 19, 2019
Generated by manServer 1.08 from 3a7d534b-f900-47d0-b3f9-72d568d49c0c using man macros.