Intel® Fortran Compiler 16.0 User and Reference Guide

IEEE_NEXT_AFTER

Elemental Module Intrinsic Function (Generic): Returns the next representable value after X toward Y. This is equivalent to the IEEE nextafter function.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

result = IEEE_NEXT_AFTER (x,y)

x

(Input) Must be of type REAL.

y

(Input) Must be of type REAL.

Results

The result type and kind is the same as x. If x is equal to y, the result is x; no exception is signaled. If x is not equal to y, the result has the value of the next representable neighbor of x toward y. The neighbors of zero (of either sign) are both nonzero.

The following exceptions are signaled under certain cases:

Exception Signalled

IEEE_OVERFLOW

When X is finite but IEEE_NEXT_AFTER(X,Y) is infinite

IEEE_UNDERFLOW

When IEEE_NEXT_AFTER(X,Y) is denormalized

IEEE_INEXACT

In both the above cases

Example

The value of IEEE_NEXT_AFTER (2.0,3.0) is 2.0 + EPSILON (X).

See Also