# 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.

Parent topic: H to I

## See Also

IEEE_ARITHMETIC Intrinsic Module
IEEE Intrinsic Modules Quick Reference Tables