xref: /illumos-gate/usr/src/head/iso/math_c99.h (revision 25c28e83)
1*25c28e83SPiotr Jasiukajtis /*
2*25c28e83SPiotr Jasiukajtis  * CDDL HEADER START
3*25c28e83SPiotr Jasiukajtis  *
4*25c28e83SPiotr Jasiukajtis  * The contents of this file are subject to the terms of the
5*25c28e83SPiotr Jasiukajtis  * Common Development and Distribution License (the "License").
6*25c28e83SPiotr Jasiukajtis  * You may not use this file except in compliance with the License.
7*25c28e83SPiotr Jasiukajtis  *
8*25c28e83SPiotr Jasiukajtis  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*25c28e83SPiotr Jasiukajtis  * or http://www.opensolaris.org/os/licensing.
10*25c28e83SPiotr Jasiukajtis  * See the License for the specific language governing permissions
11*25c28e83SPiotr Jasiukajtis  * and limitations under the License.
12*25c28e83SPiotr Jasiukajtis  *
13*25c28e83SPiotr Jasiukajtis  * When distributing Covered Code, include this CDDL HEADER in each
14*25c28e83SPiotr Jasiukajtis  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*25c28e83SPiotr Jasiukajtis  * If applicable, add the following below this CDDL HEADER, with the
16*25c28e83SPiotr Jasiukajtis  * fields enclosed by brackets "[]" replaced with your own identifying
17*25c28e83SPiotr Jasiukajtis  * information: Portions Copyright [yyyy] [name of copyright owner]
18*25c28e83SPiotr Jasiukajtis  *
19*25c28e83SPiotr Jasiukajtis  * CDDL HEADER END
20*25c28e83SPiotr Jasiukajtis  */
21*25c28e83SPiotr Jasiukajtis /*
22*25c28e83SPiotr Jasiukajtis  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
23*25c28e83SPiotr Jasiukajtis  */
24*25c28e83SPiotr Jasiukajtis /*
25*25c28e83SPiotr Jasiukajtis  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26*25c28e83SPiotr Jasiukajtis  * Use is subject to license terms.
27*25c28e83SPiotr Jasiukajtis  */
28*25c28e83SPiotr Jasiukajtis 
29*25c28e83SPiotr Jasiukajtis #ifndef _ISO_MATH_C99_H
30*25c28e83SPiotr Jasiukajtis #define	_ISO_MATH_C99_H
31*25c28e83SPiotr Jasiukajtis 
32*25c28e83SPiotr Jasiukajtis #include <sys/isa_defs.h>
33*25c28e83SPiotr Jasiukajtis #include <sys/feature_tests.h>
34*25c28e83SPiotr Jasiukajtis 
35*25c28e83SPiotr Jasiukajtis #ifdef __cplusplus
36*25c28e83SPiotr Jasiukajtis extern "C" {
37*25c28e83SPiotr Jasiukajtis #endif
38*25c28e83SPiotr Jasiukajtis 
39*25c28e83SPiotr Jasiukajtis #ifndef __P
40*25c28e83SPiotr Jasiukajtis #ifdef __STDC__
41*25c28e83SPiotr Jasiukajtis #define	__P(p)	p
42*25c28e83SPiotr Jasiukajtis #else
43*25c28e83SPiotr Jasiukajtis #define	__P(p)	()
44*25c28e83SPiotr Jasiukajtis #endif
45*25c28e83SPiotr Jasiukajtis #endif	/* !defined(__P) */
46*25c28e83SPiotr Jasiukajtis 
47*25c28e83SPiotr Jasiukajtis #if defined(_STDC_C99) || _XOPEN_SOURCE - 0 >= 600 || defined(__C99FEATURES__)
48*25c28e83SPiotr Jasiukajtis #if defined(__GNUC__)
49*25c28e83SPiotr Jasiukajtis #undef	HUGE_VAL
50*25c28e83SPiotr Jasiukajtis #define	HUGE_VAL	(__builtin_huge_val())
51*25c28e83SPiotr Jasiukajtis #undef	HUGE_VALF
52*25c28e83SPiotr Jasiukajtis #define	HUGE_VALF	(__builtin_huge_valf())
53*25c28e83SPiotr Jasiukajtis #undef	HUGE_VALL
54*25c28e83SPiotr Jasiukajtis #define	HUGE_VALL	(__builtin_huge_vall())
55*25c28e83SPiotr Jasiukajtis #undef	INFINITY
56*25c28e83SPiotr Jasiukajtis #define	INFINITY	(__builtin_inff())
57*25c28e83SPiotr Jasiukajtis #undef	NAN
58*25c28e83SPiotr Jasiukajtis #define	NAN		(__builtin_nanf(""))
59*25c28e83SPiotr Jasiukajtis 
60*25c28e83SPiotr Jasiukajtis /*
61*25c28e83SPiotr Jasiukajtis  * C99 7.12.3 classification macros
62*25c28e83SPiotr Jasiukajtis  */
63*25c28e83SPiotr Jasiukajtis #undef	isnan
64*25c28e83SPiotr Jasiukajtis #undef	isinf
65*25c28e83SPiotr Jasiukajtis #if __GNUC__ >= 4
66*25c28e83SPiotr Jasiukajtis #define	isnan(x)	__builtin_isnan(x)
67*25c28e83SPiotr Jasiukajtis #define	isinf(x)	__builtin_isinf(x)
68*25c28e83SPiotr Jasiukajtis #else
69*25c28e83SPiotr Jasiukajtis #define	isnan(x)	__extension__( \
70*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_n = (x); \
71*25c28e83SPiotr Jasiukajtis 			__builtin_isunordered(__x_n, __x_n); })
72*25c28e83SPiotr Jasiukajtis #define	isinf(x)	__extension__( \
73*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_i = (x); \
74*25c28e83SPiotr Jasiukajtis 			__x_i == (__typeof(__x_i)) INFINITY || \
75*25c28e83SPiotr Jasiukajtis 			__x_i == (__typeof(__x_i)) (-INFINITY); })
76*25c28e83SPiotr Jasiukajtis #endif
77*25c28e83SPiotr Jasiukajtis #undef	isfinite
78*25c28e83SPiotr Jasiukajtis #define	isfinite(x)	__extension__( \
79*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_f = (x); \
80*25c28e83SPiotr Jasiukajtis 			!isnan(__x_f) && !isinf(__x_f); })
81*25c28e83SPiotr Jasiukajtis #undef	isnormal
82*25c28e83SPiotr Jasiukajtis #define	isnormal(x)	__extension__( \
83*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_r = (x); isfinite(__x_r) && \
84*25c28e83SPiotr Jasiukajtis 			(sizeof (__x_r) == sizeof (float) ? \
85*25c28e83SPiotr Jasiukajtis 			__builtin_fabsf(__x_r) >= __FLT_MIN__ : \
86*25c28e83SPiotr Jasiukajtis 			sizeof (__x_r) == sizeof (double) ? \
87*25c28e83SPiotr Jasiukajtis 			__builtin_fabs(__x_r) >= __DBL_MIN__ : \
88*25c28e83SPiotr Jasiukajtis 			__builtin_fabsl(__x_r) >= __LDBL_MIN__); })
89*25c28e83SPiotr Jasiukajtis #undef	fpclassify
90*25c28e83SPiotr Jasiukajtis #define	fpclassify(x)	__extension__( \
91*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_c = (x); \
92*25c28e83SPiotr Jasiukajtis 			isnan(__x_c) ? FP_NAN : \
93*25c28e83SPiotr Jasiukajtis 			isinf(__x_c) ? FP_INFINITE : \
94*25c28e83SPiotr Jasiukajtis 			isnormal(__x_c) ? FP_NORMAL : \
95*25c28e83SPiotr Jasiukajtis 			__x_c == (__typeof(__x_c)) 0 ? FP_ZERO : \
96*25c28e83SPiotr Jasiukajtis 			FP_SUBNORMAL; })
97*25c28e83SPiotr Jasiukajtis #undef	signbit
98*25c28e83SPiotr Jasiukajtis #if defined(_BIG_ENDIAN)
99*25c28e83SPiotr Jasiukajtis #define	signbit(x)	__extension__( \
100*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_s = (x); \
101*25c28e83SPiotr Jasiukajtis 			(int) (*(unsigned *) &__x_s >> 31); })
102*25c28e83SPiotr Jasiukajtis #elif defined(_LITTLE_ENDIAN)
103*25c28e83SPiotr Jasiukajtis #define	signbit(x)	__extension__( \
104*25c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_s = (x); \
105*25c28e83SPiotr Jasiukajtis 			(sizeof (__x_s) == sizeof (float) ? \
106*25c28e83SPiotr Jasiukajtis 			(int) (*(unsigned *) &__x_s >> 31) : \
107*25c28e83SPiotr Jasiukajtis 			sizeof (__x_s) == sizeof (double) ? \
108*25c28e83SPiotr Jasiukajtis 			(int) (((unsigned *) &__x_s)[1] >> 31) : \
109*25c28e83SPiotr Jasiukajtis 			(int) (((unsigned short *) &__x_s)[4] >> 15)); })
110*25c28e83SPiotr Jasiukajtis #endif
111*25c28e83SPiotr Jasiukajtis 
112*25c28e83SPiotr Jasiukajtis /*
113*25c28e83SPiotr Jasiukajtis  * C99 7.12.14 comparison macros
114*25c28e83SPiotr Jasiukajtis  */
115*25c28e83SPiotr Jasiukajtis #undef	isgreater
116*25c28e83SPiotr Jasiukajtis #define	isgreater(x, y)		__builtin_isgreater(x, y)
117*25c28e83SPiotr Jasiukajtis #undef	isgreaterequal
118*25c28e83SPiotr Jasiukajtis #define	isgreaterequal(x, y)	__builtin_isgreaterequal(x, y)
119*25c28e83SPiotr Jasiukajtis #undef	isless
120*25c28e83SPiotr Jasiukajtis #define	isless(x, y)		__builtin_isless(x, y)
121*25c28e83SPiotr Jasiukajtis #undef	islessequal
122*25c28e83SPiotr Jasiukajtis #define	islessequal(x, y)	__builtin_islessequal(x, y)
123*25c28e83SPiotr Jasiukajtis #undef	islessgreater
124*25c28e83SPiotr Jasiukajtis #define	islessgreater(x, y)	__builtin_islessgreater(x, y)
125*25c28e83SPiotr Jasiukajtis #undef	isunordered
126*25c28e83SPiotr Jasiukajtis #define	isunordered(x, y)	__builtin_isunordered(x, y)
127*25c28e83SPiotr Jasiukajtis #else	/* defined(__GNUC__) */
128*25c28e83SPiotr Jasiukajtis #undef	HUGE_VAL
129*25c28e83SPiotr Jasiukajtis #define	HUGE_VAL	__builtin_huge_val
130*25c28e83SPiotr Jasiukajtis #undef	HUGE_VALF
131*25c28e83SPiotr Jasiukajtis #define	HUGE_VALF	__builtin_huge_valf
132*25c28e83SPiotr Jasiukajtis #undef	HUGE_VALL
133*25c28e83SPiotr Jasiukajtis #define	HUGE_VALL	__builtin_huge_vall
134*25c28e83SPiotr Jasiukajtis #undef	INFINITY
135*25c28e83SPiotr Jasiukajtis #define	INFINITY	__builtin_infinity
136*25c28e83SPiotr Jasiukajtis #undef	NAN
137*25c28e83SPiotr Jasiukajtis #define	NAN		__builtin_nan
138*25c28e83SPiotr Jasiukajtis 
139*25c28e83SPiotr Jasiukajtis /*
140*25c28e83SPiotr Jasiukajtis  * C99 7.12.3 classification macros
141*25c28e83SPiotr Jasiukajtis  */
142*25c28e83SPiotr Jasiukajtis #undef	fpclassify
143*25c28e83SPiotr Jasiukajtis #define	fpclassify(x)	__builtin_fpclassify(x)
144*25c28e83SPiotr Jasiukajtis #undef	isfinite
145*25c28e83SPiotr Jasiukajtis #define	isfinite(x)	__builtin_isfinite(x)
146*25c28e83SPiotr Jasiukajtis #undef	isinf
147*25c28e83SPiotr Jasiukajtis #define	isinf(x)	__builtin_isinf(x)
148*25c28e83SPiotr Jasiukajtis #undef	isnan
149*25c28e83SPiotr Jasiukajtis #define	isnan(x)	__builtin_isnan(x)
150*25c28e83SPiotr Jasiukajtis #undef	isnormal
151*25c28e83SPiotr Jasiukajtis #define	isnormal(x)	__builtin_isnormal(x)
152*25c28e83SPiotr Jasiukajtis #undef	signbit
153*25c28e83SPiotr Jasiukajtis #define	signbit(x)	__builtin_signbit(x)
154*25c28e83SPiotr Jasiukajtis 
155*25c28e83SPiotr Jasiukajtis /*
156*25c28e83SPiotr Jasiukajtis  * C99 7.12.14 comparison macros
157*25c28e83SPiotr Jasiukajtis  */
158*25c28e83SPiotr Jasiukajtis #undef	isgreater
159*25c28e83SPiotr Jasiukajtis #define	isgreater(x, y)		((x) __builtin_isgreater(y))
160*25c28e83SPiotr Jasiukajtis #undef	isgreaterequal
161*25c28e83SPiotr Jasiukajtis #define	isgreaterequal(x, y)	((x) __builtin_isgreaterequal(y))
162*25c28e83SPiotr Jasiukajtis #undef	isless
163*25c28e83SPiotr Jasiukajtis #define	isless(x, y)		((x) __builtin_isless(y))
164*25c28e83SPiotr Jasiukajtis #undef	islessequal
165*25c28e83SPiotr Jasiukajtis #define	islessequal(x, y)	((x) __builtin_islessequal(y))
166*25c28e83SPiotr Jasiukajtis #undef	islessgreater
167*25c28e83SPiotr Jasiukajtis #define	islessgreater(x, y)	((x) __builtin_islessgreater(y))
168*25c28e83SPiotr Jasiukajtis #undef	isunordered
169*25c28e83SPiotr Jasiukajtis #define	isunordered(x, y)	((x) __builtin_isunordered(y))
170*25c28e83SPiotr Jasiukajtis #endif	/* defined(__GNUC__) */
171*25c28e83SPiotr Jasiukajtis #endif	/* defined(_STDC_C99) || _XOPEN_SOURCE - 0 >= 600 || ... */
172*25c28e83SPiotr Jasiukajtis 
173*25c28e83SPiotr Jasiukajtis #if defined(__EXTENSIONS__) || defined(_STDC_C99) || \
174*25c28e83SPiotr Jasiukajtis 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
175*25c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
176*25c28e83SPiotr Jasiukajtis #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ - 0 == 0
177*25c28e83SPiotr Jasiukajtis typedef float float_t;
178*25c28e83SPiotr Jasiukajtis typedef double double_t;
179*25c28e83SPiotr Jasiukajtis #elif __FLT_EVAL_METHOD__ - 0 == 1
180*25c28e83SPiotr Jasiukajtis typedef double float_t;
181*25c28e83SPiotr Jasiukajtis typedef double double_t;
182*25c28e83SPiotr Jasiukajtis #elif __FLT_EVAL_METHOD__ - 0 == 2
183*25c28e83SPiotr Jasiukajtis typedef long double float_t;
184*25c28e83SPiotr Jasiukajtis typedef long double double_t;
185*25c28e83SPiotr Jasiukajtis #elif defined(__sparc) || defined(__amd64)
186*25c28e83SPiotr Jasiukajtis typedef float float_t;
187*25c28e83SPiotr Jasiukajtis typedef double double_t;
188*25c28e83SPiotr Jasiukajtis #elif defined(__i386)
189*25c28e83SPiotr Jasiukajtis typedef long double float_t;
190*25c28e83SPiotr Jasiukajtis typedef long double double_t;
191*25c28e83SPiotr Jasiukajtis #endif
192*25c28e83SPiotr Jasiukajtis 
193*25c28e83SPiotr Jasiukajtis #undef	FP_ZERO
194*25c28e83SPiotr Jasiukajtis #define	FP_ZERO		0
195*25c28e83SPiotr Jasiukajtis #undef	FP_SUBNORMAL
196*25c28e83SPiotr Jasiukajtis #define	FP_SUBNORMAL	1
197*25c28e83SPiotr Jasiukajtis #undef	FP_NORMAL
198*25c28e83SPiotr Jasiukajtis #define	FP_NORMAL	2
199*25c28e83SPiotr Jasiukajtis #undef	FP_INFINITE
200*25c28e83SPiotr Jasiukajtis #define	FP_INFINITE	3
201*25c28e83SPiotr Jasiukajtis #undef	FP_NAN
202*25c28e83SPiotr Jasiukajtis #define	FP_NAN		4
203*25c28e83SPiotr Jasiukajtis 
204*25c28e83SPiotr Jasiukajtis #undef	FP_ILOGB0
205*25c28e83SPiotr Jasiukajtis #define	FP_ILOGB0	(-2147483647)
206*25c28e83SPiotr Jasiukajtis #undef	FP_ILOGBNAN
207*25c28e83SPiotr Jasiukajtis #define	FP_ILOGBNAN	2147483647
208*25c28e83SPiotr Jasiukajtis 
209*25c28e83SPiotr Jasiukajtis #undef	MATH_ERRNO
210*25c28e83SPiotr Jasiukajtis #define	MATH_ERRNO	1
211*25c28e83SPiotr Jasiukajtis #undef	MATH_ERREXCEPT
212*25c28e83SPiotr Jasiukajtis #define	MATH_ERREXCEPT	2
213*25c28e83SPiotr Jasiukajtis #undef	math_errhandling
214*25c28e83SPiotr Jasiukajtis #define	math_errhandling	MATH_ERREXCEPT
215*25c28e83SPiotr Jasiukajtis 
216*25c28e83SPiotr Jasiukajtis extern double acosh __P((double));
217*25c28e83SPiotr Jasiukajtis extern double asinh __P((double));
218*25c28e83SPiotr Jasiukajtis extern double atanh __P((double));
219*25c28e83SPiotr Jasiukajtis 
220*25c28e83SPiotr Jasiukajtis extern double exp2 __P((double));
221*25c28e83SPiotr Jasiukajtis extern double expm1 __P((double));
222*25c28e83SPiotr Jasiukajtis extern int ilogb __P((double));
223*25c28e83SPiotr Jasiukajtis extern double log1p __P((double));
224*25c28e83SPiotr Jasiukajtis extern double log2 __P((double));
225*25c28e83SPiotr Jasiukajtis extern double logb __P((double));
226*25c28e83SPiotr Jasiukajtis extern double scalbn __P((double, int));
227*25c28e83SPiotr Jasiukajtis extern double scalbln __P((double, long int));
228*25c28e83SPiotr Jasiukajtis 
229*25c28e83SPiotr Jasiukajtis extern double cbrt __P((double));
230*25c28e83SPiotr Jasiukajtis extern double hypot __P((double, double));
231*25c28e83SPiotr Jasiukajtis 
232*25c28e83SPiotr Jasiukajtis extern double erf __P((double));
233*25c28e83SPiotr Jasiukajtis extern double erfc __P((double));
234*25c28e83SPiotr Jasiukajtis extern double lgamma __P((double));
235*25c28e83SPiotr Jasiukajtis extern double tgamma __P((double));
236*25c28e83SPiotr Jasiukajtis 
237*25c28e83SPiotr Jasiukajtis extern double nearbyint __P((double));
238*25c28e83SPiotr Jasiukajtis extern double rint __P((double));
239*25c28e83SPiotr Jasiukajtis extern long int lrint __P((double));
240*25c28e83SPiotr Jasiukajtis extern double round __P((double));
241*25c28e83SPiotr Jasiukajtis extern long int lround __P((double));
242*25c28e83SPiotr Jasiukajtis extern double trunc __P((double));
243*25c28e83SPiotr Jasiukajtis 
244*25c28e83SPiotr Jasiukajtis extern double remainder __P((double, double));
245*25c28e83SPiotr Jasiukajtis extern double remquo __P((double, double, int *));
246*25c28e83SPiotr Jasiukajtis 
247*25c28e83SPiotr Jasiukajtis extern double copysign __P((double, double));
248*25c28e83SPiotr Jasiukajtis extern double nan __P((const char *));
249*25c28e83SPiotr Jasiukajtis extern double nextafter __P((double, double));
250*25c28e83SPiotr Jasiukajtis extern double nexttoward __P((double, long double));
251*25c28e83SPiotr Jasiukajtis 
252*25c28e83SPiotr Jasiukajtis extern double fdim __P((double, double));
253*25c28e83SPiotr Jasiukajtis extern double fmax __P((double, double));
254*25c28e83SPiotr Jasiukajtis extern double fmin __P((double, double));
255*25c28e83SPiotr Jasiukajtis 
256*25c28e83SPiotr Jasiukajtis extern double fma __P((double, double, double));
257*25c28e83SPiotr Jasiukajtis 
258*25c28e83SPiotr Jasiukajtis extern float acosf __P((float));
259*25c28e83SPiotr Jasiukajtis extern float asinf __P((float));
260*25c28e83SPiotr Jasiukajtis extern float atanf __P((float));
261*25c28e83SPiotr Jasiukajtis extern float atan2f __P((float, float));
262*25c28e83SPiotr Jasiukajtis extern float cosf __P((float));
263*25c28e83SPiotr Jasiukajtis extern float sinf __P((float));
264*25c28e83SPiotr Jasiukajtis extern float tanf __P((float));
265*25c28e83SPiotr Jasiukajtis 
266*25c28e83SPiotr Jasiukajtis extern float acoshf __P((float));
267*25c28e83SPiotr Jasiukajtis extern float asinhf __P((float));
268*25c28e83SPiotr Jasiukajtis extern float atanhf __P((float));
269*25c28e83SPiotr Jasiukajtis extern float coshf __P((float));
270*25c28e83SPiotr Jasiukajtis extern float sinhf __P((float));
271*25c28e83SPiotr Jasiukajtis extern float tanhf __P((float));
272*25c28e83SPiotr Jasiukajtis 
273*25c28e83SPiotr Jasiukajtis extern float expf __P((float));
274*25c28e83SPiotr Jasiukajtis extern float exp2f __P((float));
275*25c28e83SPiotr Jasiukajtis extern float expm1f __P((float));
276*25c28e83SPiotr Jasiukajtis extern float frexpf __P((float, int *));
277*25c28e83SPiotr Jasiukajtis extern int ilogbf __P((float));
278*25c28e83SPiotr Jasiukajtis extern float ldexpf __P((float, int));
279*25c28e83SPiotr Jasiukajtis extern float logf __P((float));
280*25c28e83SPiotr Jasiukajtis extern float log10f __P((float));
281*25c28e83SPiotr Jasiukajtis extern float log1pf __P((float));
282*25c28e83SPiotr Jasiukajtis extern float log2f __P((float));
283*25c28e83SPiotr Jasiukajtis extern float logbf __P((float));
284*25c28e83SPiotr Jasiukajtis extern float modff __P((float, float *));
285*25c28e83SPiotr Jasiukajtis extern float scalbnf __P((float, int));
286*25c28e83SPiotr Jasiukajtis extern float scalblnf __P((float, long int));
287*25c28e83SPiotr Jasiukajtis 
288*25c28e83SPiotr Jasiukajtis extern float cbrtf __P((float));
289*25c28e83SPiotr Jasiukajtis extern float fabsf __P((float));
290*25c28e83SPiotr Jasiukajtis extern float hypotf __P((float, float));
291*25c28e83SPiotr Jasiukajtis extern float powf __P((float, float));
292*25c28e83SPiotr Jasiukajtis extern float sqrtf __P((float));
293*25c28e83SPiotr Jasiukajtis 
294*25c28e83SPiotr Jasiukajtis extern float erff __P((float));
295*25c28e83SPiotr Jasiukajtis extern float erfcf __P((float));
296*25c28e83SPiotr Jasiukajtis extern float lgammaf __P((float));
297*25c28e83SPiotr Jasiukajtis extern float tgammaf __P((float));
298*25c28e83SPiotr Jasiukajtis 
299*25c28e83SPiotr Jasiukajtis extern float ceilf __P((float));
300*25c28e83SPiotr Jasiukajtis extern float floorf __P((float));
301*25c28e83SPiotr Jasiukajtis extern float nearbyintf __P((float));
302*25c28e83SPiotr Jasiukajtis extern float rintf __P((float));
303*25c28e83SPiotr Jasiukajtis extern long int lrintf __P((float));
304*25c28e83SPiotr Jasiukajtis extern float roundf __P((float));
305*25c28e83SPiotr Jasiukajtis extern long int lroundf __P((float));
306*25c28e83SPiotr Jasiukajtis extern float truncf __P((float));
307*25c28e83SPiotr Jasiukajtis 
308*25c28e83SPiotr Jasiukajtis extern float fmodf __P((float, float));
309*25c28e83SPiotr Jasiukajtis extern float remainderf __P((float, float));
310*25c28e83SPiotr Jasiukajtis extern float remquof __P((float, float, int *));
311*25c28e83SPiotr Jasiukajtis 
312*25c28e83SPiotr Jasiukajtis extern float copysignf __P((float, float));
313*25c28e83SPiotr Jasiukajtis extern float nanf __P((const char *));
314*25c28e83SPiotr Jasiukajtis extern float nextafterf __P((float, float));
315*25c28e83SPiotr Jasiukajtis extern float nexttowardf __P((float, long double));
316*25c28e83SPiotr Jasiukajtis 
317*25c28e83SPiotr Jasiukajtis extern float fdimf __P((float, float));
318*25c28e83SPiotr Jasiukajtis extern float fmaxf __P((float, float));
319*25c28e83SPiotr Jasiukajtis extern float fminf __P((float, float));
320*25c28e83SPiotr Jasiukajtis 
321*25c28e83SPiotr Jasiukajtis extern float fmaf __P((float, float, float));
322*25c28e83SPiotr Jasiukajtis 
323*25c28e83SPiotr Jasiukajtis extern long double acosl __P((long double));
324*25c28e83SPiotr Jasiukajtis extern long double asinl __P((long double));
325*25c28e83SPiotr Jasiukajtis extern long double atanl __P((long double));
326*25c28e83SPiotr Jasiukajtis extern long double atan2l __P((long double, long double));
327*25c28e83SPiotr Jasiukajtis extern long double cosl __P((long double));
328*25c28e83SPiotr Jasiukajtis extern long double sinl __P((long double));
329*25c28e83SPiotr Jasiukajtis extern long double tanl __P((long double));
330*25c28e83SPiotr Jasiukajtis 
331*25c28e83SPiotr Jasiukajtis extern long double acoshl __P((long double));
332*25c28e83SPiotr Jasiukajtis extern long double asinhl __P((long double));
333*25c28e83SPiotr Jasiukajtis extern long double atanhl __P((long double));
334*25c28e83SPiotr Jasiukajtis extern long double coshl __P((long double));
335*25c28e83SPiotr Jasiukajtis extern long double sinhl __P((long double));
336*25c28e83SPiotr Jasiukajtis extern long double tanhl __P((long double));
337*25c28e83SPiotr Jasiukajtis 
338*25c28e83SPiotr Jasiukajtis extern long double expl __P((long double));
339*25c28e83SPiotr Jasiukajtis extern long double exp2l __P((long double));
340*25c28e83SPiotr Jasiukajtis extern long double expm1l __P((long double));
341*25c28e83SPiotr Jasiukajtis extern long double frexpl __P((long double, int *));
342*25c28e83SPiotr Jasiukajtis extern int ilogbl __P((long double));
343*25c28e83SPiotr Jasiukajtis extern long double ldexpl __P((long double, int));
344*25c28e83SPiotr Jasiukajtis extern long double logl __P((long double));
345*25c28e83SPiotr Jasiukajtis extern long double log10l __P((long double));
346*25c28e83SPiotr Jasiukajtis extern long double log1pl __P((long double));
347*25c28e83SPiotr Jasiukajtis extern long double log2l __P((long double));
348*25c28e83SPiotr Jasiukajtis extern long double logbl __P((long double));
349*25c28e83SPiotr Jasiukajtis extern long double modfl __P((long double, long double *));
350*25c28e83SPiotr Jasiukajtis extern long double scalbnl __P((long double, int));
351*25c28e83SPiotr Jasiukajtis extern long double scalblnl __P((long double, long int));
352*25c28e83SPiotr Jasiukajtis 
353*25c28e83SPiotr Jasiukajtis extern long double cbrtl __P((long double));
354*25c28e83SPiotr Jasiukajtis extern long double fabsl __P((long double));
355*25c28e83SPiotr Jasiukajtis extern long double hypotl __P((long double, long double));
356*25c28e83SPiotr Jasiukajtis extern long double powl __P((long double, long double));
357*25c28e83SPiotr Jasiukajtis extern long double sqrtl __P((long double));
358*25c28e83SPiotr Jasiukajtis 
359*25c28e83SPiotr Jasiukajtis extern long double erfl __P((long double));
360*25c28e83SPiotr Jasiukajtis extern long double erfcl __P((long double));
361*25c28e83SPiotr Jasiukajtis extern long double lgammal __P((long double));
362*25c28e83SPiotr Jasiukajtis extern long double tgammal __P((long double));
363*25c28e83SPiotr Jasiukajtis 
364*25c28e83SPiotr Jasiukajtis extern long double ceill __P((long double));
365*25c28e83SPiotr Jasiukajtis extern long double floorl __P((long double));
366*25c28e83SPiotr Jasiukajtis extern long double nearbyintl __P((long double));
367*25c28e83SPiotr Jasiukajtis extern long double rintl __P((long double));
368*25c28e83SPiotr Jasiukajtis extern long int lrintl __P((long double));
369*25c28e83SPiotr Jasiukajtis extern long double roundl __P((long double));
370*25c28e83SPiotr Jasiukajtis extern long int lroundl __P((long double));
371*25c28e83SPiotr Jasiukajtis extern long double truncl __P((long double));
372*25c28e83SPiotr Jasiukajtis 
373*25c28e83SPiotr Jasiukajtis extern long double fmodl __P((long double, long double));
374*25c28e83SPiotr Jasiukajtis extern long double remainderl __P((long double, long double));
375*25c28e83SPiotr Jasiukajtis extern long double remquol __P((long double, long double, int *));
376*25c28e83SPiotr Jasiukajtis 
377*25c28e83SPiotr Jasiukajtis extern long double copysignl __P((long double, long double));
378*25c28e83SPiotr Jasiukajtis extern long double nanl __P((const char *));
379*25c28e83SPiotr Jasiukajtis extern long double nextafterl __P((long double, long double));
380*25c28e83SPiotr Jasiukajtis extern long double nexttowardl __P((long double, long double));
381*25c28e83SPiotr Jasiukajtis 
382*25c28e83SPiotr Jasiukajtis extern long double fdiml __P((long double, long double));
383*25c28e83SPiotr Jasiukajtis extern long double fmaxl __P((long double, long double));
384*25c28e83SPiotr Jasiukajtis extern long double fminl __P((long double, long double));
385*25c28e83SPiotr Jasiukajtis 
386*25c28e83SPiotr Jasiukajtis extern long double fmal __P((long double, long double, long double));
387*25c28e83SPiotr Jasiukajtis 
388*25c28e83SPiotr Jasiukajtis #if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
389*25c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
390*25c28e83SPiotr Jasiukajtis extern long long int llrint __P((double));
391*25c28e83SPiotr Jasiukajtis extern long long int llround __P((double));
392*25c28e83SPiotr Jasiukajtis 
393*25c28e83SPiotr Jasiukajtis extern long long int llrintf __P((float));
394*25c28e83SPiotr Jasiukajtis extern long long int llroundf __P((float));
395*25c28e83SPiotr Jasiukajtis 
396*25c28e83SPiotr Jasiukajtis extern long long int llrintl __P((long double));
397*25c28e83SPiotr Jasiukajtis extern long long int llroundl __P((long double));
398*25c28e83SPiotr Jasiukajtis #endif
399*25c28e83SPiotr Jasiukajtis 
400*25c28e83SPiotr Jasiukajtis #if !defined(__cplusplus)
401*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(asinh, exp2, expm1)
402*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ilogb, log2)
403*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(scalbn, scalbln, cbrt)
404*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(erf, erfc, tgamma)
405*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(nearbyint, rint, lrint, round, lround, trunc)
406*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(remquo)
407*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(copysign, nan, nexttoward)
408*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fdim, fmax, fmin, fma)
409*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(asinh, exp2, expm1)
410*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ilogb, log2)
411*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(scalbn, scalbln, cbrt)
412*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(erf, erfc, tgamma)
413*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(nearbyint, rint, lrint, round, lround, trunc)
414*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(copysign, nan, nexttoward)
415*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fdim, fmax, fmin, fma)
416*25c28e83SPiotr Jasiukajtis 
417*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acosf, asinf, atanf, atan2f)
418*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cosf, sinf, tanf)
419*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acoshf, asinhf, atanhf, coshf, sinhf, tanhf)
420*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(expf, exp2f, expm1f, frexpf, ilogbf, ldexpf)
421*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(logf, log10f, log1pf, log2f, logbf)
422*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(modff, scalbnf, scalblnf)
423*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cbrtf, fabsf, hypotf, powf, sqrtf)
424*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(erff, erfcf, lgammaf, tgammaf)
425*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ceilf, floorf, nearbyintf)
426*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(rintf, lrintf, roundf, lroundf, truncf)
427*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fmodf, remainderf, remquof)
428*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(copysignf, nanf, nextafterf, nexttowardf)
429*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fdimf, fmaxf, fminf, fmaf)
430*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acosf, asinf, atanf, atan2f)
431*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cosf, sinf, tanf)
432*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acoshf, asinhf, atanhf, coshf, sinhf, tanhf)
433*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(expf, exp2f, expm1f, ilogbf, ldexpf)
434*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(logf, log10f, log1pf, log2f, logbf)
435*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cbrtf, fabsf, hypotf, powf, sqrtf)
436*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(erff, erfcf, tgammaf)
437*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ceilf, floorf, nearbyintf)
438*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(rintf, lrintf, roundf, lroundf, truncf)
439*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fmodf, remainderf)
440*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(copysignf, nanf, nextafterf, nexttowardf)
441*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fdimf, fmaxf, fminf, fmaf)
442*25c28e83SPiotr Jasiukajtis 
443*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acosl, asinl, atanl, atan2l)
444*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cosl, sinl, tanl)
445*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acoshl, asinhl, atanhl, coshl, sinhl, tanhl)
446*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(expl, exp2l, expm1l, frexpl, ilogbl, ldexpl)
447*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(logl, log10l, log1pl, log2l, logbl)
448*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(modfl, scalbnl, scalblnl)
449*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cbrtl, fabsl, hypotl, powl, sqrtl)
450*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(erfl, erfcl, lgammal, tgammal)
451*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ceill, floorl, nearbyintl)
452*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(rintl, lrintl, roundl, lroundl, truncl)
453*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fmodl, remainderl, remquol)
454*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(copysignl, nanl, nextafterl, nexttowardl)
455*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fdiml, fmaxl, fminl, fmal)
456*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acosl, asinl, atanl, atan2l)
457*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cosl, sinl, tanl)
458*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acoshl, asinhl, atanhl, coshl, sinhl, tanhl)
459*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(expl, exp2l, expm1l, ilogbl, ldexpl)
460*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(logl, log10l, log1pl, log2l, logbl)
461*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cbrtl, fabsl, hypotl, powl, sqrtl)
462*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(erfl, erfcl, tgammal)
463*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ceill, floorl, nearbyintl)
464*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(rintl, lrintl, roundl, lroundl, truncl)
465*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fmodl, remainderl)
466*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(copysignl, nanl, nextafterl, nexttowardl)
467*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fdiml, fmaxl, fminl, fmal)
468*25c28e83SPiotr Jasiukajtis 
469*25c28e83SPiotr Jasiukajtis #if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
470*25c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
471*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(llrint, llround)
472*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(llrintf, llroundf, llrintl, llroundl)
473*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(llrint, llround)
474*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(llrintf, llroundf, llrintl, llroundl)
475*25c28e83SPiotr Jasiukajtis #endif
476*25c28e83SPiotr Jasiukajtis #endif	/* !defined(__cplusplus) */
477*25c28e83SPiotr Jasiukajtis 
478*25c28e83SPiotr Jasiukajtis #if defined(__MATHERR_ERRNO_DONTCARE)
479*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acosh, atanh, hypot, lgamma, log1p, logb)
480*25c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(nextafter, remainder)
481*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acosh, atanh, hypot, log1p, logb)
482*25c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(nextafter, remainder)
483*25c28e83SPiotr Jasiukajtis 
484*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(acosh, asinh, atanh, exp2, expm1)
485*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(ilogb, log1p, log2, logb)
486*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(scalbn, scalbln, cbrt, hypot)
487*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(erf, erfc, tgamma)
488*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(nearbyint, rint, lrint, round, lround, trunc)
489*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(remainder)
490*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(copysign, nan, nextafter, nexttoward)
491*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(fdim, fmax, fmin, fma)
492*25c28e83SPiotr Jasiukajtis 
493*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(acosf, asinf, atanf, atan2f)
494*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(cosf, sinf, tanf, coshf, sinhf, tanhf)
495*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(acoshf, asinhf, atanhf, coshf, sinhf, tanhf)
496*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(expf, exp2f, expm1f, ilogbf, ldexpf)
497*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(logf, log10f, log1pf, log2f, logbf)
498*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(cbrtf, fabsf, hypotf, powf, sqrtf)
499*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(erff, erfcf, tgammaf)
500*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(ceilf, floorf, nearbyintf)
501*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(rintf, lrintf, roundf, lroundf, truncf)
502*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(fmodf, remainderf)
503*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(copysignf, nanf, nextafterf, nexttowardf)
504*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(fdimf, fmaxf, fminf, fmaf)
505*25c28e83SPiotr Jasiukajtis 
506*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(acosl, asinl, atanl, atan2l)
507*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(cosl, sinl, tanl, coshl, sinhl, tanhl)
508*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(acoshl, asinhl, atanhl, coshl, sinhl, tanhl)
509*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(expl, exp2l, expm1l, ilogbl, ldexpl)
510*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(logl, log10l, log1pl, log2l, logbl)
511*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(cbrtl, fabsl, hypotl, powl, sqrtl)
512*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(erfl, erfcl, tgammal)
513*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(ceill, floorl, nearbyintl)
514*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(rintl, lrintl, roundl, lroundl, truncl)
515*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(fmodl, remainderl)
516*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(copysignl, nanl, nextafterl, nexttowardl)
517*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(fdiml, fmaxl, fminl, fmal)
518*25c28e83SPiotr Jasiukajtis 
519*25c28e83SPiotr Jasiukajtis #if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
520*25c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
521*25c28e83SPiotr Jasiukajtis #pragma no_side_effect(llrint, llround, llrintf, llroundf, llrintl, llroundl)
522*25c28e83SPiotr Jasiukajtis #endif
523*25c28e83SPiotr Jasiukajtis #endif	/* defined(__MATHERR_ERRNO_DONTCARE) */
524*25c28e83SPiotr Jasiukajtis #endif	/* defined(__EXTENSIONS__) || defined(_STDC_C99) || ... */
525*25c28e83SPiotr Jasiukajtis 
526*25c28e83SPiotr Jasiukajtis #ifdef __cplusplus
527*25c28e83SPiotr Jasiukajtis }
528*25c28e83SPiotr Jasiukajtis #endif
529*25c28e83SPiotr Jasiukajtis 
530*25c28e83SPiotr Jasiukajtis #endif	/* _ISO_MATH_C99_H */
531