Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

IEEE_COPY_SIGN

Elemental Module Intrinsic Function (Generic): Returns an argument with a copied sign. This is equivalent to the IEEE copySign function.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

result = IEEE_COPY_SIGN (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. The result has the value x with the sign of y. This is true even for IEEE special values, such as NaN or infinity.

The flags information is returned as a set of 1-bit flags.

Example

The value of IEEE_COPY_SIGN (X,3.0) is ABS (X), even when X is NaN.