Namespaces
Variants
Views
Actions

std::cos

From cppreference.com
< cpp | numeric | math
Revision as of 16:34, 4 May 2012 by P12bot (Talk | contribs)

Template:cpp/numeric/math/sidebar

Defined in header <cmath>
float       cos( float arg );
double      cos( double arg );
long double cos( long double arg );
double      cos( Integral arg );
(since C++11)

Computes cosine of arg

Parameters

arg - floating point value representing angle in radians

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.

See also

computes sine (sin(x))
(function) [edit]
computes tangent (tan(x))
(function) [edit]
computes arc cosine (arccos(x))
(function) [edit]
computes cosine of a complex number (cos(z))
(function template) [edit]
applies the function std::cos to each element of valarray
(function template) [edit]