Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math
m (r2.7.3) (Robot: Adding de, es, it, ru)
m (Shorten template names. Use {{lc}} where appropriate.)
Line 1: Line 1:
 
{{cpp/title|acos}}
 
{{cpp/title|acos}}
 
{{cpp/numeric/math/navbar}}
 
{{cpp/numeric/math/navbar}}
{{ddcl list begin}}
+
{{dcl begin}}
{{ddcl list header | cmath}}
+
{{dcl header | cmath}}
{{ddcl list item |
+
{{dcl |
 
float      acos( float arg );
 
float      acos( float arg );
 
}}
 
}}
{{ddcl list item |
+
{{dcl |
 
double      acos( double arg );
 
double      acos( double arg );
 
}}
 
}}
{{ddcl list item |
+
{{dcl |
 
long double acos( long double arg );
 
long double acos( long double arg );
 
}}
 
}}
{{ddcl list item | notes={{mark since c++11}} |
+
{{dcl | notes={{mark since c++11}} |
 
double      acos( Integral arg );
 
double      acos( Integral arg );
 
}}
 
}}
{{ddcl list end}}
+
{{dcl end}}
  
 
Computes arc cosine of {{tt|arg}}
 
Computes arc cosine of {{tt|arg}}
  
 
===Parameters===
 
===Parameters===
{{param list begin}}
+
{{par begin}}
{{param list item | arg | floating point value}}
+
{{par | arg | floating point value}}
{{param list end}}
+
{{par end}}
  
 
===Return value===
 
===Return value===
 
Arc cosine of {{tt|arg}} in radians in the range of {{tt|[0; &pi;]}} radians.
 
Arc cosine of {{tt|arg}} in radians in the range of {{tt|[0; &pi;]}} radians.
  
Domain error occurs if {{tt|arg}} is outside the range {{tt|[-1.0; 1.0]}}. {{c|NAN}} is returned in that case.
+
Domain error occurs if {{tt|arg}} is outside the range {{tt|[-1.0; 1.0]}}. {{lc|NAN}} is returned in that case.
  
 
===Example===
 
===Example===
Line 44: Line 44:
  
 
===See also===
 
===See also===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list template | cpp/numeric/math/dcl list asin}}
+
{{dsc inc | cpp/numeric/math/dcl list asin}}
{{dcl list template | cpp/numeric/math/dcl list atan}}
+
{{dsc inc | cpp/numeric/math/dcl list atan}}
{{dcl list template | cpp/numeric/math/dcl list atan2}}
+
{{dsc inc | cpp/numeric/math/dcl list atan2}}
{{dcl list template | cpp/numeric/math/dcl list cos}}
+
{{dsc inc | cpp/numeric/math/dcl list cos}}
{{dcl list template | cpp/numeric/complex/dcl list acos}}
+
{{dsc inc | cpp/numeric/complex/dcl list acos}}
{{dcl list template | cpp/numeric/valarray/dcl list acos}}
+
{{dsc inc | cpp/numeric/valarray/dcl list acos}}
{{dcl list end}}
+
{{dsc end}}
  
 
[[de:cpp/numeric/math/acos]]
 
[[de:cpp/numeric/math/acos]]

Revision as of 19:19, 31 May 2013

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

Computes arc cosine of arg

Contents

Parameters

arg - floating point value

Return value

Arc cosine of arg in radians in the range of [0; π] radians.

Domain error occurs if arg is outside the range [-1.0; 1.0]. NAN is returned in that case.

Example

#include <cmath>
#include <iostream>
 
int main()
{
    std::cout << "The number pi is " << std::acos(-1) << '\n';
}

Output:

The number pi is 3.14159

See also

Template:cpp/numeric/math/dcl list asinTemplate:cpp/numeric/math/dcl list atanTemplate:cpp/numeric/math/dcl list atan2Template:cpp/numeric/math/dcl list cosTemplate:cpp/numeric/complex/dcl list acosTemplate:cpp/numeric/valarray/dcl list acos