OSDN Git Service

(split) LDP_man-pages: update original to v3.34.
[linuxjm/LDP_man-pages.git] / original / man3 / cacosh.3
1 .\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gamil.com>
3 .\" Distributed under GPL
4 .\"
5 .TH CACOSH 3 2011-09-15 "" "Linux Programmer's Manual"
6 .SH NAME
7 cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
8 .SH SYNOPSIS
9 .B #include <complex.h>
10 .sp
11 .BI "double complex cacosh(double complex " z );
12 .br
13 .BI "float complex cacoshf(float complex " z );
14 .br
15 .BI "long double complex cacoshl(long double complex " z );
16 .sp
17 Link with \fI\-lm\fP.
18 .SH DESCRIPTION
19 The
20 .BR cacosh ()
21 function calculates the complex arc hyperpolic cosine of
22 .IR z .
23 If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP.
24 The imaginary part of
25 .I y
26 is chosen in the interval [\-pi,pi].
27 The real part of
28 .I y
29 is chosen nonnegative.
30 .LP
31 One has:
32 .nf
33
34     cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
35 .fi
36 .SH VERSIONS
37 These functions first appeared in glibc in version 2.1.
38 .SH "CONFORMING TO"
39 C99.
40 .SH EXAMPLE
41 .nf
42 /* Link with "\-lm" */
43
44 #include <complex.h>
45 #include <stdlib.h>
46 #include <unistd.h>
47 #include <stdio.h>
48
49 int
50 main(int argc, char *argv[])
51 {
52     double complex z, c, f;
53
54     if (argc != 3) {
55         fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
56         exit(EXIT_FAILURE);
57     }
58
59     z = atof(argv[1]) + atof(argv[2]) * I;
60
61     c = cacosh(z);
62     printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
63
64     f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
65     printf("formula  = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
66
67     exit(EXIT_SUCCESS);
68 }
69 .fi
70 .SH "SEE ALSO"
71 .BR acosh (3),
72 .BR cabs (3),
73 .BR ccosh (3),
74 .BR cimag (3),
75 .BR complex (7)