CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Pages

Valid RSS

CMath.h

acos

About | FAQ | Contact
About FAQ Contact

Arc cosine function

viewed 26396 times


+View other versions (3)
Contents -

Interface

#include <math.h>
double acos (double x)
long double acosl (long double x)
float acosf (float x)

#include <complex.h>
complex acos (complex x)
double complex cacos (double complex x)
float complex cacosf (float complex x)
long double complex cacosl (long double complex x)

Description

The acos function computes the principal value of the arc cosine of x in the range [0, \pi]. acosl and acosf are the long double and the float versions, correspondingly.

The complex inverse cosine is defined by:
Example 1:
#include <stdio.h>
#include <math.h>
 
int main()
{
  double x = 0.5;
  double result = acos(x);
  printf("The arc cosine of %lf is %lf\n", x, result);
  return 0;
}

Output:
The arc cosine of 0.500000 is 1.047198

Special Values

acos ( 1 ) returns +0.
acos ( x ) returns a NaN and raises the invalid floating-point exception for |x| > 1.

See Also

sin, cos, tan, asin, atan, atan2, sinh, cosh, tanh

Standards

The acos function conforms to ISO/IEC 9899:1999(E).

Compatibility

DOSUNIXWindowsANSI CC++ only
acosl
Real acos
Complex acos
Complex cacos

Last Modified: 2009-11-01 08:46:33     Page Rendered: 2010-03-14 08:06:06

Page Comments

Format Excel Equations

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional