Intel® Fortran Compiler 16.0 User and Reference Guide

IEEE_REM

Elemental Module Intrinsic Function (Generic): Returns the result value from a remainder operation. This is equivalent to the IEEE rem 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.

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.

See Also