source: trunk/sys/libm/include/libm/fdlibm.h @ 1

Last change on this file since 1 was 1, checked in by alain, 7 years ago

First import

File size: 6.0 KB
Line 
1
2/* @(#)fdlibm.h 5.1 93/09/24 */
3/*
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 *
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 * ====================================================
12 */
13
14/**
15  @file
16  @module {Math library}
17  @short Fdlibm header
18
19  Developed at SunPro, a Sun Microsystems, Inc. business.
20  Permission to use, copy, modify, and distribute this
21  software is freely granted, provided that this notice
22  is preserved.
23 */
24
25#define __P(p)  p
26
27/** @this is ANSI/POSIX */
28extern int signgam;
29
30/** @this defines exterm values */
31#define MAXFLOAT        ((float)3.40282346638528860e+38)
32#define HUGE            MAXFLOAT
33
34/** @multiple @hidden */
35enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
36#define _LIB_VERSION_TYPE enum fdversion
37#define _LIB_VERSION _fdlib_version 
38
39/** @multiple @hidden if global variable _LIB_VERSION is not desirable, one may
40 * change the following to be a constant by:
41 *      #define _LIB_VERSION_TYPE const enum version
42 * In that case, after one initializes the value _LIB_VERSION (see
43 * s_lib_version.c) during compile time, it cannot be modified
44 * in the middle of a program
45 */ 
46extern  _LIB_VERSION_TYPE  _LIB_VERSION;
47
48#define _IEEE_  fdlibm_ieee
49#define _SVID_  fdlibm_svid
50#define _XOPEN_ fdlibm_xopen
51#define _POSIX_ fdlibm_posix
52
53/** @internal */
54struct exception {
55        int type;
56        char *name;
57        double arg1;
58        double arg2;
59        double retval;
60};
61
62/** @this sets X_TLOSS to pi*2**52 */
63#define X_TLOSS         1.41484755040568800000e+16
64
65/** @multiple */
66#define DOMAIN          1
67#define SING            2
68#define OVERFLOW        3
69#define UNDERFLOW       4
70#define TLOSS           5
71#define PLOSS           6
72
73/**
74 * @multiple
75 * @this is an ANSI/POSIX math function
76 */
77extern double acos __P((double));
78extern double asin __P((double));
79extern double atan __P((double));
80extern double atan2 __P((double, double));
81extern double cos __P((double));
82extern double sin __P((double));
83extern double tan __P((double));
84
85extern double cosh __P((double));
86extern double sinh __P((double));
87extern double tanh __P((double));
88
89extern double exp __P((double));
90extern double frexp __P((double, int *));
91extern double ldexp __P((double, int));
92extern double log __P((double));
93extern double log10 __P((double));
94extern double modf __P((double, double *));
95
96extern double pow __P((double, double));
97extern double sqrt __P((double));
98
99extern double ceil __P((double));
100extern double fabs __P((double));
101extern double floor __P((double));
102extern double fmod __P((double, double));
103
104extern double erf __P((double));
105extern double erfc __P((double));
106extern double gamma __P((double));
107extern double hypot __P((double, double));
108extern int isnan __P((double));
109extern int finite __P((double));
110extern double j0 __P((double));
111extern double j1 __P((double));
112extern double jn __P((int, double));
113extern double lgamma __P((double));
114extern double y0 __P((double));
115extern double y1 __P((double));
116extern double yn __P((int, double));
117
118extern double acosh __P((double));
119extern double asinh __P((double));
120extern double atanh __P((double));
121extern double cbrt __P((double));
122extern double logb __P((double));
123extern double nextafter __P((double, double));
124extern double remainder __P((double, double));
125#ifdef _SCALB_INT
126extern double scalb __P((double, int));
127#else
128extern double scalb __P((double, double));
129#endif
130
131extern int matherr __P((struct exception *));
132
133/**
134 * @this is IEEE Test Vector
135 */
136extern double significand __P((double));
137
138/**
139 * @multiple
140 * @this is callable from C, intended to support IEEE arithmetic.
141 */
142extern double copysign __P((double, double));
143extern int ilogb __P((double));
144extern double rint __P((double));
145extern double scalbn __P((double, int));
146
147/**
148 * @multiple
149 * BSD math library entry point
150 */
151extern double expm1 __P((double));
152extern double log1p __P((double));
153
154/**
155 * @multiple @this is a reentrant version of gamma & lgamma; passes
156 * signgam back by reference as the second argument; user must
157 * allocate space for signgam.
158 */
159#ifdef _REENTRANT
160extern double gamma_r __P((double, int *));
161extern double lgamma_r __P((double, int *));
162#endif  /* _REENTRANT */
163
164/** @internal @multiple @this is an IEEE style elementary function */
165extern double __ieee754_sqrt __P((double));                     
166extern double __ieee754_acos __P((double));                     
167extern double __ieee754_acosh __P((double));                   
168extern double __ieee754_log __P((double));                     
169extern double __ieee754_atanh __P((double));                   
170extern double __ieee754_asin __P((double));                     
171extern double __ieee754_atan2 __P((double,double));                     
172extern double __ieee754_exp __P((double));
173extern double __ieee754_cosh __P((double));
174extern double __ieee754_fmod __P((double,double));
175extern double __ieee754_pow __P((double,double));
176extern double __ieee754_lgamma_r __P((double,int *));
177extern double __ieee754_gamma_r __P((double,int *));
178extern double __ieee754_lgamma __P((double));
179extern double __ieee754_gamma __P((double));
180extern double __ieee754_log10 __P((double));
181extern double __ieee754_sinh __P((double));
182extern double __ieee754_hypot __P((double,double));
183extern double __ieee754_j0 __P((double));
184extern double __ieee754_j1 __P((double));
185extern double __ieee754_y0 __P((double));
186extern double __ieee754_y1 __P((double));
187extern double __ieee754_jn __P((int,double));
188extern double __ieee754_yn __P((int,double));
189extern double __ieee754_remainder __P((double,double));
190extern int    __ieee754_rem_pio2 __P((double,double*));
191#ifdef _SCALB_INT
192extern double __ieee754_scalb __P((double,int));
193#else
194extern double __ieee754_scalb __P((double,double));
195#endif
196
197/** @internal @multiple @this is a fdlibm kernel function */
198extern double __kernel_standard __P((double,double,int));       
199extern double __kernel_sin __P((double,double,int));
200extern double __kernel_cos __P((double,double));
201extern double __kernel_tan __P((double,double,int));
202extern int    __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
Note: See TracBrowser for help on using the repository browser.