1 | |
---|
2 | /* @(#)z_acos.c 1.0 98/08/13 */ |
---|
3 | |
---|
4 | /* |
---|
5 | FUNCTION |
---|
6 | <<acos>>, <<acosf>>---arc cosine |
---|
7 | |
---|
8 | INDEX |
---|
9 | acos |
---|
10 | INDEX |
---|
11 | acosf |
---|
12 | |
---|
13 | SYNOPSIS |
---|
14 | #include <math.h> |
---|
15 | double acos(double <[x]>); |
---|
16 | float acosf(float <[x]>); |
---|
17 | |
---|
18 | DESCRIPTION |
---|
19 | |
---|
20 | <<acos>> computes the inverse cosine (arc cosine) of the input value. |
---|
21 | Arguments to <<acos>> must be in the range @minus{}1 to 1. |
---|
22 | |
---|
23 | <<acosf>> is identical to <<acos>>, except that it performs |
---|
24 | its calculations on <<floats>>. |
---|
25 | |
---|
26 | RETURNS |
---|
27 | @ifnottex |
---|
28 | <<acos>> and <<acosf>> return values in radians, in the range of 0 to pi |
---|
29 | . |
---|
30 | @end ifnottex |
---|
31 | @tex |
---|
32 | <<acos>> and <<acosf>> return values in radians, in the range of <<0>> t |
---|
33 | o $\pi$. |
---|
34 | @end tex |
---|
35 | |
---|
36 | If <[x]> is not between @minus{}1 and 1, the returned value is NaN |
---|
37 | (not a number) the global variable <<errno>> is set to <<EDOM>>, and a |
---|
38 | <<DOMAIN error>> message is sent as standard error output. |
---|
39 | |
---|
40 | You can modify error handling for these functions using <<matherr>>. |
---|
41 | |
---|
42 | |
---|
43 | QUICKREF |
---|
44 | ansi svid posix rentrant |
---|
45 | acos y,y,y,m |
---|
46 | acosf n,n,n,m |
---|
47 | |
---|
48 | MATHREF |
---|
49 | acos, [-1,1], acos(arg),,, |
---|
50 | acos, NAN, arg,DOMAIN,EDOM |
---|
51 | |
---|
52 | MATHREF |
---|
53 | acosf, [-1,1], acosf(arg),,, |
---|
54 | acosf, NAN, argf,DOMAIN,EDOM |
---|
55 | |
---|
56 | */ |
---|
57 | |
---|
58 | /***************************************************************** |
---|
59 | * Arccosine |
---|
60 | * |
---|
61 | * Input: |
---|
62 | * x - floating point value |
---|
63 | * |
---|
64 | * Output: |
---|
65 | * arccosine of x |
---|
66 | * |
---|
67 | * Description: |
---|
68 | * This routine returns the arccosine of x. |
---|
69 | * |
---|
70 | *****************************************************************/ |
---|
71 | |
---|
72 | #include "fdlibm.h" |
---|
73 | #include "zmath.h" |
---|
74 | |
---|
75 | #ifndef _DOUBLE_IS_32BITS |
---|
76 | |
---|
77 | double |
---|
78 | acos (double x) |
---|
79 | { |
---|
80 | return (asine (x, 1)); |
---|
81 | } |
---|
82 | |
---|
83 | #endif /* _DOUBLE_IS_32BITS */ |
---|