The Wayback Machine - https://web.archive.org/web/20251208131418/https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-2/ieee-max-num-mag.html

Intel® Fortran Compiler

Developer Guide and Reference

ID 767251
Date 6/30/2025
Public
Document Table of Contents

IEEE_MAX_NUM_MAG

Inquiry Module Intrinsic Function (Generic): Returns the numeric maximum magnitude of two values. This is equivalent to the IEEE maximumMagnitudeNumber operation.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

result = IEEE_MAX_NUM_MAG (x,y)

x

(Input) Must be of type REAL.

y

(Input) Must be of type REAL with the same kind type parameter as x.

Results

The result type is REAL with the same kind type parameter as x. The result is x if ABS(y) < ABS(x). The result is the value of y if ABS(x) < ABS(y). Otherwise, the result is the same as IEEE_MAX_NUM (x, y).

If either or both of the arguments is a signaling NaN, the exception IEEE_INVALID is signaled. Unless both arguments are signaling NaNs, the signaling NaN is otherwise ignored and not converted to a quiet NaN. No other exceptions are signaled.

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

Example

The result value of IEEE_MAX_NUM_MAG (3.7, -7.5) is -7.5.