fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libm / math / wf_asin.c
bloba5225f2f44ce045ea30807a9fc38bffdb5f433fb
1 /* wf_asin.c -- float version of w_asin.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 */
5 /*
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
12 * is preserved.
13 * ====================================================
17 /*
18 * wrapper asinf(x)
22 #include "fdlibm.h"
23 #include <errno.h>
25 #ifdef __STDC__
26 float asinf(float x) /* wrapper asinf */
27 #else
28 float asinf(x) /* wrapper asinf */
29 float x;
30 #endif
32 #ifdef _IEEE_LIBM
33 return __ieee754_asinf(x);
34 #else
35 float z;
36 struct exception exc;
37 z = __ieee754_asinf(x);
38 if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
39 if(fabsf(x)>(float)1.0) {
40 /* asinf(|x|>1) */
41 exc.type = DOMAIN;
42 exc.name = "asinf";
43 exc.err = 0;
44 exc.arg1 = exc.arg2 = (double)x;
45 exc.retval = 0.0;
46 if(_LIB_VERSION == _POSIX_)
47 errno = EDOM;
48 else if (!matherr(&exc)) {
49 errno = EDOM;
51 if (exc.err != 0)
52 errno = exc.err;
53 return (float)exc.retval;
54 } else
55 return z;
56 #endif
59 #ifdef _DOUBLE_IS_32BITS
61 #ifdef __STDC__
62 double asin(double x)
63 #else
64 double asin(x)
65 double x;
66 #endif
68 return (double) asinf((float) x);
71 #endif /* defined(_DOUBLE_IS_32BITS) */