Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

IEEE_NEXT_UP

Elemental Module Intrinsic Function (Generic): Returns the next higher adjacent machine number. This is equivalent to the IEEE nextUp operation.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

result = IEEE_NEXT_UP (x)

x

(Input) Must be of type REAL.

Results

The result type and kind are the same as x. The value of the result is the least value that compares greater than x - except when x has the value NaN, the result is NaN, and when x has the value + ∞, the result is + ∞. If x is a signaling NaN, IEEE_INVALID signals; otherwise, no exception is signaled.

This is the nextUp operation as specified in the ISO/IEC 60559:2020 standard.

Example

The value of IEEE_NEXT_UP (HUGE (x)) is + ∞ if the value of IEEE_SUPPORT_INF (x) is .true..