|
|
1.1 root 1:
2:
3: cosh() Mathematics Function cosh()
4:
5:
6:
7:
8: Calculate hyperbolic cosine
9:
10: #include <math.h>
11: ddoouubbllee ccoosshh(_r_a_d_i_a_n) ddoouubbllee _r_a_d_i_a_n;
12:
13: cosh calculates the hyperbolic cosine of radian, which is in
14: radian measure.
15:
16: ***** Example *****
17:
18: The following program prompts you for a number; it then uses
19: cosh, sinh, and tanh to generate, respectively, the hyperbolic
20: cosine, sine, and tangent of your number.
21:
22:
23: #include <math.h>
24: #include <stdio.h>
25: #define display(x) dodisplay((double)(x), #x)
26:
27:
28:
29: dodisplay(value, name)
30: double value; char *name;
31: {
32: if (errno)
33: perror(name);
34: else
35: printf("%10g %s\n", value, name);
36: errno = 0;
37: }
38:
39:
40:
41: main()
42: {
43: extern char *gets();
44: double x;
45: char string[64];
46:
47:
48:
49: for(;;) {
50: printf("Enter number: ");
51: if(gets(string) == NULL)
52: break;
53: x = atof(string);
54:
55:
56:
57: display(x);
58: display(cosh(x));
59: display(sinh(x));
60: display(tanh(x));
61: }
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
67:
68:
69: cosh() Mathematics Function cosh()
70:
71:
72:
73: }
74:
75:
76: ***** See Also *****
77:
78: mathematics library
79:
80: ***** Diagnostics *****
81:
82: When overflow occurs, cosh returns a huge value that has the same
83: sign as the actual result.
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130: COHERENT Lexicon Page 2
131:
132:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.