Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3362 | Serge | 1 | |
2 | /* |
||
3 | * ==================================================== |
||
4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
||
5 | * |
||
6 | * Developed at SunPro, a Sun Microsystems, Inc. business. |
||
7 | * Permission to use, copy, modify, and distribute this |
||
8 | * software is freely granted, provided that this notice |
||
9 | * is preserved. |
||
10 | * ==================================================== |
||
11 | */ |
||
12 | |||
13 | |||
14 | FUNCTION |
||
15 | < |
||
16 | |||
17 | |||
18 | acos |
||
19 | INDEX |
||
20 | acosf |
||
21 | |||
22 | |||
23 | #include |
||
24 | double acos(double <[x]>); |
||
25 | float acosf(float <[x]>); |
||
26 | |||
27 | |||
28 | #include |
||
29 | double acos(<[x]>) |
||
30 | double <[x]>; |
||
31 | |||
32 | |||
33 | float <[x]>; |
||
34 | |||
35 | |||
36 | |||
37 | |||
38 | |||
39 | |||
40 | Arguments to < |
||
41 | |||
42 | |||
43 | its calculations on < |
||
44 | |||
45 | |||
46 | @ifnottex |
||
47 | < |
||
48 | @end ifnottex |
||
49 | @tex |
||
50 | < |
||
51 | @end tex |
||
52 | |||
53 | |||
54 | (not a number) the global variable < |
||
55 | < |
||
56 | |||
57 | |||
58 | |||
59 | |||
60 | |||
61 | acos y,y,y,m |
||
62 | acosf n,n,n,m |
||
63 | |||
64 | |||
65 | acos, [-1,1], acos(arg),,, |
||
66 | acos, NAN, arg,DOMAIN,EDOM |
||
67 | |||
68 | |||
69 | acosf, [-1,1], acosf(arg),,, |
||
70 | acosf, NAN, argf,DOMAIN,EDOM |
||
71 | |||
72 | |||
73 | |||
74 | |||
75 | * wrap_acos(x) |
||
76 | */ |
||
77 | |||
78 | |||
79 | #include |
||
80 | |||
81 | |||
82 | |||
83 | |||
84 | double acos(double x) /* wrapper acos */ |
||
85 | #else |
||
86 | double acos(x) /* wrapper acos */ |
||
87 | double x; |
||
88 | #endif |
||
89 | { |
||
90 | #ifdef _IEEE_LIBM |
||
91 | return __ieee754_acos(x); |
||
92 | #else |
||
93 | double z; |
||
94 | struct exception exc; |
||
95 | z = __ieee754_acos(x); |
||
96 | if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; |
||
97 | if(fabs(x)>1.0) { |
||
98 | /* acos(|x|>1) */ |
||
99 | exc.type = DOMAIN; |
||
100 | exc.name = "acos"; |
||
101 | exc.err = 0; |
||
102 | exc.arg1 = exc.arg2 = x; |
||
103 | exc.retval = nan(""); |
||
104 | if (_LIB_VERSION == _POSIX_) |
||
105 | errno = EDOM; |
||
106 | else if (!matherr(&exc)) { |
||
107 | errno = EDOM; |
||
108 | } |
||
109 | if (exc.err != 0) |
||
110 | errno = exc.err; |
||
111 | return exc.retval; |
||
112 | } else |
||
113 | return z; |
||
114 | #endif |
||
115 | } |
||
116 | |||
117 | |||
118 |