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

ID 767251
Date 3/22/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_REM

Elemental Module Intrinsic Function (Generic): Returns the result of an exact remainder operation. This is equivalent to the IEEE remainder function.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

result = IEEE_REM (x,y)

x

(Input) Must be of type REAL.

y

(Input) Must be of type REAL with a radix that is the same as that of x.

Results

The result type is real with the kind type parameter of whichever argument has greater precision.

Regardless of the rounding mode, the result value is x - y*N, where N is the integer nearest to the value x / y. If |N – x / y | = 1/2, N is even. If the result value is zero, the sign is the same as x.

Example

The value of IEEE_REM (5.0,4.0) is 1.0; the value of IEEE_REM (2.0,1.0) is 0.0; the value of IEEE_REM (3.0,2.0) is -1.0.