# acoshl Function

Calculates the arc hyperbolic cosine function of a long double precision floating-point value.

Include

<math.h>

Prototype

long double acoshl(long double x);

Argument

 x value for which to return the arc hyperbolic cosine

Return Value

Returns the arc hyperbolic cosine of x in the range [0, ∞] radians (inclusive) or NaN if a domain error occurs.

Remarks

If x is less than 1, a domain error will occur and errno will be set to EDOM.

Example

See the notes at the beginning of this chapter or section for information on using printf() or scanf() (and other functions reading and writing the stdin or stdout streams) in the example code.

#include <math.h>
#include <stdio.h>
#include <errno.h>

int main(void)
{
long double x, y;

errno = 0;
x = 0.0;
y = acoshl(x);
if (errno)
perror("Error");
printf("The arc hyperbolic cosine of %Lf is %Lf\n", x, y);

errno = 0;
x = 1.0;
y = acoshl(x);
if (errno)
perror("Error");
printf("The arc hyperbolic cosine of %Lf is %Lf\n", x, y);

errno = 0;
x = 720.0;
y = acoshl(x);
if (errno)
perror("Error");
printf("The arc hyperbolic cosine of %Lf is %Lf\n", x, y);
}

Example Output


Error: domain error
The arc hyperbolic cosine of 0.000000 is nan
The arc hyperbolic cosine of 1.000000 is 0.000000
The arc hyperbolic cosine of 720.000000 is 7.272398