Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.base/share/native/libfdlibm/fdlibm.h
41149 views
1
/*
2
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
#ifdef _ALLBSD_SOURCE
27
#include <machine/endian.h>
28
#elif defined(__linux__)
29
#define __USE_BSD 1
30
#include <endian.h>
31
#endif
32
#include "jfdlibm.h"
33
34
#ifdef __NEWVALID /* special setup for Sun test regime */
35
#if defined(i386) || defined(i486) || \
36
defined(intel) || defined(x86) || defined(arm) || \
37
defined(i86pc) || defined(ia64)
38
#define _LITTLE_ENDIAN
39
#endif
40
#endif
41
42
#ifdef _LITTLE_ENDIAN
43
#define __HI(x) *(1+(int*)&x)
44
#define __LO(x) *(int*)&x
45
#define __HIp(x) *(1+(int*)x)
46
#define __LOp(x) *(int*)x
47
#else
48
#define __HI(x) *(int*)&x
49
#define __LO(x) *(1+(int*)&x)
50
#define __HIp(x) *(int*)x
51
#define __LOp(x) *(1+(int*)x)
52
#endif
53
54
#ifndef __P
55
#ifdef __STDC__
56
#define __P(p) p
57
#else
58
#define __P(p) ()
59
#endif
60
#endif
61
62
/*
63
* ANSI/POSIX
64
*/
65
66
extern int signgam;
67
68
#define MAXFLOAT ((float)3.40282346638528860e+38)
69
70
enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
71
72
#define _LIB_VERSION_TYPE enum fdversion
73
#define _LIB_VERSION _fdlib_version
74
75
/* if global variable _LIB_VERSION is not desirable, one may
76
* change the following to be a constant by:
77
* #define _LIB_VERSION_TYPE const enum version
78
* In that case, after one initializes the value _LIB_VERSION (see
79
* s_lib_version.c) during compile time, it cannot be modified
80
* in the middle of a program
81
*/
82
extern _LIB_VERSION_TYPE _LIB_VERSION;
83
84
#define _IEEE_ fdlibm_ieee
85
#define _SVID_ fdlibm_svid
86
#define _XOPEN_ fdlibm_xopen
87
#define _POSIX_ fdlibm_posix
88
89
struct exception {
90
int type;
91
char *name;
92
double arg1;
93
double arg2;
94
double retval;
95
};
96
97
#define HUGE MAXFLOAT
98
99
/*
100
* set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
101
* (one may replace the following line by "#include <values.h>")
102
*/
103
104
#define X_TLOSS 1.41484755040568800000e+16
105
106
#define DOMAIN 1
107
#define SING 2
108
#define OVERFLOW 3
109
#define UNDERFLOW 4
110
#define TLOSS 5
111
#define PLOSS 6
112
113
/*
114
* ANSI/POSIX
115
*/
116
extern double acos __P((double));
117
extern double asin __P((double));
118
extern double atan __P((double));
119
extern double atan2 __P((double, double));
120
extern double cos __P((double));
121
extern double sin __P((double));
122
extern double tan __P((double));
123
124
extern double cosh __P((double));
125
extern double sinh __P((double));
126
extern double tanh __P((double));
127
128
extern double exp __P((double));
129
extern double frexp __P((double, int *));
130
extern double ldexp __P((double, int));
131
extern double log __P((double));
132
extern double log10 __P((double));
133
extern double modf __P((double, double *));
134
135
extern double sqrt __P((double));
136
137
extern double ceil __P((double));
138
extern double fabs __P((double));
139
extern double floor __P((double));
140
extern double fmod __P((double, double));
141
142
extern double hypot __P((double, double));
143
extern int isnan __P((double));
144
extern int finite __P((double));
145
146
extern double atanh __P((double));
147
extern double cbrt __P((double));
148
extern double logb __P((double));
149
extern double nextafter __P((double, double));
150
extern double remainder __P((double, double));
151
#ifdef _SCALB_INT
152
extern double scalb __P((double, int));
153
#else
154
extern double scalb __P((double, double));
155
#endif
156
157
extern int matherr __P((struct exception *));
158
159
/*
160
* IEEE Test Vector
161
*/
162
extern double significand __P((double));
163
164
/*
165
* Functions callable from C, intended to support IEEE arithmetic.
166
*/
167
extern double copysign __P((double, double));
168
extern int ilogb __P((double));
169
extern double rint __P((double));
170
extern double scalbn __P((double, int));
171
172
/*
173
* BSD math library entry points
174
*/
175
extern double expm1 __P((double));
176
extern double log1p __P((double));
177
178
/* ieee style elementary functions */
179
extern double __ieee754_sqrt __P((double));
180
extern double __ieee754_acos __P((double));
181
extern double __ieee754_log __P((double));
182
extern double __ieee754_atanh __P((double));
183
extern double __ieee754_asin __P((double));
184
extern double __ieee754_atan2 __P((double,double));
185
extern double __ieee754_exp __P((double));
186
extern double __ieee754_cosh __P((double));
187
extern double __ieee754_fmod __P((double,double));
188
extern double __ieee754_log10 __P((double));
189
extern double __ieee754_sinh __P((double));
190
extern double __ieee754_hypot __P((double,double));
191
extern double __ieee754_remainder __P((double,double));
192
extern int __ieee754_rem_pio2 __P((double,double*));
193
#ifdef _SCALB_INT
194
extern double __ieee754_scalb __P((double,int));
195
#else
196
extern double __ieee754_scalb __P((double,double));
197
#endif
198
199
/* fdlibm kernel function */
200
extern double __kernel_standard __P((double,double,int));
201
extern double __kernel_sin __P((double,double,int));
202
extern double __kernel_cos __P((double,double));
203
extern double __kernel_tan __P((double,double,int));
204
extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
205
206