Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/math/cos"

From cppreference.com
< cpp‎ | numeric‎ | math
(+see c)
m (link is_integral, otherwise "Integral arg" is confusing.)
Line 21: Line 21:
 
===Parameters===
 
===Parameters===
 
{{par begin}}
 
{{par begin}}
{{par | arg | floating point value representing angle in radians}}
+
{{par | arg | value representing angle in radians, of a floating-point or [[cpp/types/is_integral|Integral type]]}}
 
{{par end}}
 
{{par end}}
  

Revision as of 08:32, 23 January 2014

 
 
 
 
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 - value representing angle in radians, of a floating-point or Integral type

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

(C++11)(C++11)
computes sine (sin(x))
(function) [edit]
(C++11)(C++11)
computes tangent (tan(x))
(function) [edit]
(C++11)(C++11)
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]