#
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 September 19, 2010 10:20:09
by

Jason Blevins
(174.101.53.244)
(621 characters / 0.0 pages)