Difference between revisions of "cpp/numeric/math/acos"
From cppreference.com
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}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{dcl header | cmath}} |
− | {{ | + | {{dcl | |
float acos( float arg ); | float acos( float arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl | |
double acos( double arg ); | double acos( double arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl | |
long double acos( long double arg ); | long double acos( long double arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} | |
double acos( Integral arg ); | double acos( Integral arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl end}} |
Computes arc cosine of {{tt|arg}} | Computes arc cosine of {{tt|arg}} | ||
===Parameters=== | ===Parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | arg | floating point value}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Arc cosine of {{tt|arg}} in radians in the range of {{tt|[0; π]}} radians. | Arc cosine of {{tt|arg}} in radians in the range of {{tt|[0; π]}} radians. | ||
− | Domain error occurs if {{tt|arg}} is outside the range {{tt|[-1.0; 1.0]}}. {{ | + | 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=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list asin}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list atan}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list atan2}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list cos}} |
− | {{ | + | {{dsc inc | cpp/numeric/complex/dcl list acos}} |
− | {{ | + | {{dsc inc | cpp/numeric/valarray/dcl list acos}} |
− | {{ | + | {{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
Run this code
#include <cmath> #include <iostream> int main() { std::cout << "The number pi is " << std::acos(-1) << '\n'; }
Output:
The number pi is 3.14159