##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# cos

From cppreference.com
< c‎ | numeric‎ | math

Defined in header `<math.h>` |  |
float cosf( float arg ); |  | (since C99)
double cos( double arg ); |  |
long double cosl( long double arg ); |  | (since C99)

Computes cosine of `arg`

### [edit] Parameters

arg | - | floating point value representing angle in radians

### [edit] Return value

Cosine of `arg` in the range `[-1.0 ; 1.0]`.

Domain error occurs if `arg` is infinite. NAN is returned in that case.

### [edit] See also

sin | computes sine (sin(x)) (function) [edit]
tan | computes tangent (tan(x)) (function) [edit]
acos | computes arc cosine (arccos(x)) (function) [edit]
C++ documentation for cos

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/math/cos&oldid=62567"