Dead
[official-gcc.git] / gomp-20050608-branch / libjava / classpath / native / fdlibm / w_asin.c
blobf6cb271d3920a3ccf22ea8a869030cdfbfbb5274
2 /* @(#)w_asin.c 5.1 93/09/24 */
3 /*
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
10 * is preserved.
11 * ====================================================
16 FUNCTION
17 <<asin>>, <<asinf>>---arc sine
19 INDEX
20 asin
21 INDEX
22 asinf
24 ANSI_SYNOPSIS
25 #include <math.h>
26 double asin(double <[x]>);
27 float asinf(float <[x]>);
29 TRAD_SYNOPSIS
30 #include <math.h>
31 double asin(<[x]>)
32 double <[x]>;
34 float asinf(<[x]>)
35 float <[x]>;
38 DESCRIPTION
40 <<asin>> computes the inverse sine (arc sine) of the argument <[x]>.
41 Arguments to <<asin>> must be in the range @minus{}1 to 1.
43 <<asinf>> is identical to <<asin>>, other than taking and
44 returning floats.
46 You can modify error handling for these routines using <<matherr>>.
48 RETURNS
49 @ifinfo
50 <<asin>> returns values in radians, in the range of -pi/2 to pi/2.
51 @end ifinfo
52 @tex
53 <<asin>> returns values in radians, in the range of $-\pi/2$ to $\pi/2$.
54 @end tex
56 If <[x]> is not in the range @minus{}1 to 1, <<asin>> and <<asinf>>
57 return NaN (not a number), set the global variable <<errno>> to
58 <<EDOM>>, and issue a <<DOMAIN error>> message.
60 You can change this error treatment using <<matherr>>.
62 QUICKREF ANSI SVID POSIX RENTRANT
63 asin y,y,y,m
64 asinf n,n,n,m
66 MATHREF
67 asin, -1<=arg<=1, asin(arg),,,
68 asin, NAN, arg,EDOM, DOMAIN
70 MATHREF
71 asinf, -1<=arg<=1, asin(arg),,,
72 asinf, NAN, arg,EDOM, DOMAIN
77 /*
78 * wrapper asin(x)
82 #include "fdlibm.h"
83 #include <errno.h>
85 #ifndef _DOUBLE_IS_32BITS
87 #ifdef __STDC__
88 double asin(double x) /* wrapper asin */
89 #else
90 double asin(x) /* wrapper asin */
91 double x;
92 #endif
94 #ifdef _IEEE_LIBM
95 return __ieee754_asin(x);
96 #else
97 double z;
98 struct exception exc;
99 z = __ieee754_asin(x);
100 if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
101 if(fabs(x)>1.0) {
102 /* asin(|x|>1) */
103 exc.type = DOMAIN;
104 exc.name = "asin";
105 exc.err = 0;
106 exc.arg1 = exc.arg2 = x;
107 exc.retval = 0.0;
108 if(_LIB_VERSION == _POSIX_)
109 errno = EDOM;
110 else if (!matherr(&exc)) {
111 errno = EDOM;
113 if (exc.err != 0)
114 errno = exc.err;
115 return exc.retval;
116 } else
117 return z;
118 #endif
121 #endif /* defined(_DOUBLE_IS_32BITS) */