NEAREST(X,S)

Purpose

Returns the nearest different processor-representable number in the direction indicated by the sign of S (toward positive or negative infinity).

Class

Elemental function

Argument type and attributes

X
An INTENT(IN) REAL
S
An INTENT(IN) REAL. Its value cannot be zero.

Result type and attributes

Same as X.

Result value

The result is the machine number different from and nearest to X in the direction of the infinity with the same sign as S.

Examples

IBM extension begins NEAREST (3.0, 2.0) = 3.0 + 2.0(-22). See Real data model. IBM extension ends