#
Fortran Wiki

cos

## Description

`cos(x)`

computes the cosine of `x`

.

## Standard

FORTRAN 77 and later

## Class

Elemental function

## Syntax

`result = cos(x)`

## Arguments

`x`

- The type shall be `real`

or `complex`

.

## Return value

The return value is of the same type and kind as `x`

. The real part of the result is in radians. If `x`

is of the type `real`

, the return value lies in the range $-1 \leq \cos (x) \leq 1$.

## Example

```
program test_cos
real :: x = 0.0
x = cos(x)
end program test_cos
```

## See also

acos, sin, tan

Revised on March 1, 2023 13:08:06
by

Jason Blevins
(23.245.217.121)
(661 characters / 0.0 pages)