LF Fortran 95

RRSPACING Function

Description

The RRSPACING function returns the reciprocal of relative spacing near a given number.

Syntax

RRSPACING (x)

Arguments

x is an INTENT(IN) scalar or array of type REAL.

Result

The result is of the same type and kind as x. Its value is the reciprocal of the spacing; x divided by SPACING(x)

Example

real(kind(1.e0)) :: r10=1.e0 real(kind(1.d0)) :: r100=1.d0 real(kind(1.q0)) :: r1000=1.q0 write(*,*) r10/spacing(r10) ! writes 8388608.00 write(*,*) rrspacing(r10) ! writes 8388608.00 write(*,*) rrspacing(r100) ! writes 4503599627370496. write(*,*) rrspacing(r1000) ! writes 5192296858534827628530496329220096.0