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