C acosh function calculates the arc hyperbolic cosine

Syntax

The declaration of acosh has the following forms.

  • float acoshf(float arg);
  • double acosh(double arg);
  • long double acoshl(long double arg);

acosh function is from header file math.h.

Description

The return value is the arc hyperbolic cosine of arg. Parameter of acosh must be zero or greater; otherwise a domain error will occur.

Example

The following code calculates the arc hyperbolic cosine in a loop.


#include <math.h>
#include <stdio.h>
//from ww w.ja va 2 s  .com
int main(void)
{
  double val = -1.0;

  do {
    printf(" %f.\n", val, acosh(val));
    val += 1;
  } while(val<=10.0);

  return 0;
}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h