2 /* @(#)w_acos.c 5.1 93/09/24 */
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunPro, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
11 * ====================================================
16 <<acos>>, <<acosf>>---arc cosine
25 double acos(double <[x]>);
26 float acosf(float <[x]>);
40 <<acos>> computes the inverse cosine (arc cosine) of the input value.
41 Arguments to <<acos>> must be in the range @minus{}1 to 1.
43 <<acosf>> is identical to <<acos>>, except that it performs
44 its calculations on <<floats>>.
48 <<acos>> and <<acosf>> return values in radians, in the range of 0 to pi.
51 <<acos>> and <<acosf>> return values in radians, in the range of <<0>> to $\pi$.
54 If <[x]> is not between @minus{}1 and 1, the returned value is NaN
55 (not a number) the global variable <<errno>> is set to <<EDOM>>, and a
56 <<DOMAIN error>> message is sent as standard error output.
58 You can modify error handling for these functions using <<matherr>>.
61 QUICKREF ANSI SVID POSIX RENTRANT
66 acos, [-1,1], acos(arg),,,
67 acos, NAN, arg,DOMAIN,EDOM
70 acosf, [-1,1], acosf(arg),,,
71 acosf, NAN, argf,DOMAIN,EDOM
82 #ifndef _DOUBLE_IS_32BITS
85 double acos(double x
) /* wrapper acos */
87 double acos(x
) /* wrapper acos */
92 return __ieee754_acos(x
);
96 z
= __ieee754_acos(x
);
97 if(_LIB_VERSION
== _IEEE_
|| isnan(x
)) return z
;
103 exc
.arg1
= exc
.arg2
= x
;
105 if (_LIB_VERSION
== _POSIX_
)
107 else if (!matherr(&exc
)) {
118 #endif /* defined(_DOUBLE_IS_32BITS) */