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

ID 767251
Date 3/31/2023
Public

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

Document Table of Contents

COS

Elemental Intrinsic Function (Generic): Produces the cosine of an argument.

result = COS (x)

x

(Input) Must be of type real or complex. It must be in radians and is treated as modulo 2*pi.

Results

The result type and kind are the same as x.

If x is of type real, the result is a value in radians.

If x is of type complex, the real part of the result is a value in radians.

Specific Name

Argument Type

Result Type

COS

REAL(4)

REAL(4)

DCOS

REAL(8)

REAL(8)

QCOS

REAL(16)

REAL(16)

CCOS 1

COMPLEX(4)

COMPLEX(4)

CDCOS 2

COMPLEX(8)

COMPLEX(8)

CQCOS

COMPLEX(16)

COMPLEX(16)

1The setting of compiler options specifying real size can affect CCOS.

2This function can also be specified as ZCOS.

Example

COS (2.0) has the value -0.4161468.

COS (0.567745) has the value 0.8431157.