Visible to Intel only — GUID: GUID-DA06D5F2-0D62-4157-8112-B05A4815710D
Visible to Intel only — GUID: GUID-DA06D5F2-0D62-4157-8112-B05A4815710D
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 are 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 | Signaled |
---|---|
IEEE_OVERFLOW |
When X is finite but IEEE_NEXT_AFTER(X,Y) is infinite |
IEEE_UNDERFLOW |
When IEEE_NEXT_AFTER(X,Y) is subnormal |
IEEE_INEXACT |
In both the above cases |
Example
The value of IEEE_NEXT_AFTER (2.0,3.0) is 2.0 + EPSILON (X).