xref: /illumos-gate/usr/src/head/iso/math_c99.h (revision 685c1a21)
125c28e83SPiotr Jasiukajtis /*
225c28e83SPiotr Jasiukajtis  * CDDL HEADER START
325c28e83SPiotr Jasiukajtis  *
425c28e83SPiotr Jasiukajtis  * The contents of this file are subject to the terms of the
525c28e83SPiotr Jasiukajtis  * Common Development and Distribution License (the "License").
625c28e83SPiotr Jasiukajtis  * You may not use this file except in compliance with the License.
725c28e83SPiotr Jasiukajtis  *
825c28e83SPiotr Jasiukajtis  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
925c28e83SPiotr Jasiukajtis  * or http://www.opensolaris.org/os/licensing.
1025c28e83SPiotr Jasiukajtis  * See the License for the specific language governing permissions
1125c28e83SPiotr Jasiukajtis  * and limitations under the License.
1225c28e83SPiotr Jasiukajtis  *
1325c28e83SPiotr Jasiukajtis  * When distributing Covered Code, include this CDDL HEADER in each
1425c28e83SPiotr Jasiukajtis  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1525c28e83SPiotr Jasiukajtis  * If applicable, add the following below this CDDL HEADER, with the
1625c28e83SPiotr Jasiukajtis  * fields enclosed by brackets "[]" replaced with your own identifying
1725c28e83SPiotr Jasiukajtis  * information: Portions Copyright [yyyy] [name of copyright owner]
1825c28e83SPiotr Jasiukajtis  *
1925c28e83SPiotr Jasiukajtis  * CDDL HEADER END
2025c28e83SPiotr Jasiukajtis  */
2125c28e83SPiotr Jasiukajtis /*
2225c28e83SPiotr Jasiukajtis  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
2325c28e83SPiotr Jasiukajtis  */
2425c28e83SPiotr Jasiukajtis /*
2525c28e83SPiotr Jasiukajtis  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
2625c28e83SPiotr Jasiukajtis  * Use is subject to license terms.
2725c28e83SPiotr Jasiukajtis  */
2825c28e83SPiotr Jasiukajtis 
2925c28e83SPiotr Jasiukajtis #ifndef _ISO_MATH_C99_H
3025c28e83SPiotr Jasiukajtis #define	_ISO_MATH_C99_H
3125c28e83SPiotr Jasiukajtis 
3225c28e83SPiotr Jasiukajtis #include <sys/isa_defs.h>
3325c28e83SPiotr Jasiukajtis #include <sys/feature_tests.h>
3425c28e83SPiotr Jasiukajtis 
3525c28e83SPiotr Jasiukajtis #ifdef __cplusplus
3625c28e83SPiotr Jasiukajtis extern "C" {
3725c28e83SPiotr Jasiukajtis #endif
3825c28e83SPiotr Jasiukajtis 
39f26364c9SRichard Lowe #undef	FP_ZERO
40f26364c9SRichard Lowe #define	FP_ZERO		0
41f26364c9SRichard Lowe #undef	FP_SUBNORMAL
42f26364c9SRichard Lowe #define	FP_SUBNORMAL	1
43f26364c9SRichard Lowe #undef	FP_NORMAL
44f26364c9SRichard Lowe #define	FP_NORMAL	2
45f26364c9SRichard Lowe #undef	FP_INFINITE
46f26364c9SRichard Lowe #define	FP_INFINITE	3
47f26364c9SRichard Lowe #undef	FP_NAN
48f26364c9SRichard Lowe #define	FP_NAN		4
49f26364c9SRichard Lowe 
5025c28e83SPiotr Jasiukajtis #if defined(_STDC_C99) || _XOPEN_SOURCE - 0 >= 600 || defined(__C99FEATURES__)
5125c28e83SPiotr Jasiukajtis #if defined(__GNUC__)
5225c28e83SPiotr Jasiukajtis #undef	HUGE_VAL
5325c28e83SPiotr Jasiukajtis #define	HUGE_VAL	(__builtin_huge_val())
5425c28e83SPiotr Jasiukajtis #undef	HUGE_VALF
5525c28e83SPiotr Jasiukajtis #define	HUGE_VALF	(__builtin_huge_valf())
5625c28e83SPiotr Jasiukajtis #undef	HUGE_VALL
5725c28e83SPiotr Jasiukajtis #define	HUGE_VALL	(__builtin_huge_vall())
5825c28e83SPiotr Jasiukajtis #undef	INFINITY
5925c28e83SPiotr Jasiukajtis #define	INFINITY	(__builtin_inff())
6025c28e83SPiotr Jasiukajtis #undef	NAN
6125c28e83SPiotr Jasiukajtis #define	NAN		(__builtin_nanf(""))
6225c28e83SPiotr Jasiukajtis 
6325c28e83SPiotr Jasiukajtis /*
6425c28e83SPiotr Jasiukajtis  * C99 7.12.3 classification macros
6525c28e83SPiotr Jasiukajtis  */
6625c28e83SPiotr Jasiukajtis #undef	isnan
6725c28e83SPiotr Jasiukajtis #undef	isinf
6825c28e83SPiotr Jasiukajtis #if __GNUC__ >= 4
69f26364c9SRichard Lowe #define	fpclassify(x)	__builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, \
70f26364c9SRichard Lowe     FP_SUBNORMAL, FP_ZERO, x)
71*685c1a21SRichard Lowe #define	isnan(x)	__builtin_isnan(x)
72*685c1a21SRichard Lowe #define	isinf(x)	__builtin_isinf(x)
73*685c1a21SRichard Lowe #define	isfinite(x)	(__builtin_isfinite(x) != 0)
74*685c1a21SRichard Lowe #define	isnormal(x)	(__builtin_isnormal(x) != 0)
75*685c1a21SRichard Lowe #define	signbit(x)	(__builtin_signbit(x) != 0)
76f26364c9SRichard Lowe #else  /* __GNUC__ >= 4 */
7725c28e83SPiotr Jasiukajtis #define	isnan(x)	__extension__( \
7825c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_n = (x); \
7925c28e83SPiotr Jasiukajtis 			__builtin_isunordered(__x_n, __x_n); })
8025c28e83SPiotr Jasiukajtis #define	isinf(x)	__extension__( \
8125c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_i = (x); \
8225c28e83SPiotr Jasiukajtis 			__x_i == (__typeof(__x_i)) INFINITY || \
8325c28e83SPiotr Jasiukajtis 			__x_i == (__typeof(__x_i)) (-INFINITY); })
8425c28e83SPiotr Jasiukajtis #undef	isfinite
8525c28e83SPiotr Jasiukajtis #define	isfinite(x)	__extension__( \
8625c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_f = (x); \
8725c28e83SPiotr Jasiukajtis 			!isnan(__x_f) && !isinf(__x_f); })
8825c28e83SPiotr Jasiukajtis #undef	isnormal
8925c28e83SPiotr Jasiukajtis #define	isnormal(x)	__extension__( \
9025c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_r = (x); isfinite(__x_r) && \
9125c28e83SPiotr Jasiukajtis 			(sizeof (__x_r) == sizeof (float) ? \
9225c28e83SPiotr Jasiukajtis 			__builtin_fabsf(__x_r) >= __FLT_MIN__ : \
9325c28e83SPiotr Jasiukajtis 			sizeof (__x_r) == sizeof (double) ? \
9425c28e83SPiotr Jasiukajtis 			__builtin_fabs(__x_r) >= __DBL_MIN__ : \
9525c28e83SPiotr Jasiukajtis 			__builtin_fabsl(__x_r) >= __LDBL_MIN__); })
9625c28e83SPiotr Jasiukajtis #undef	fpclassify
9725c28e83SPiotr Jasiukajtis #define	fpclassify(x)	__extension__( \
9825c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_c = (x); \
9925c28e83SPiotr Jasiukajtis 			isnan(__x_c) ? FP_NAN : \
10025c28e83SPiotr Jasiukajtis 			isinf(__x_c) ? FP_INFINITE : \
10125c28e83SPiotr Jasiukajtis 			isnormal(__x_c) ? FP_NORMAL : \
10225c28e83SPiotr Jasiukajtis 			__x_c == (__typeof(__x_c)) 0 ? FP_ZERO : \
10325c28e83SPiotr Jasiukajtis 			FP_SUBNORMAL; })
10425c28e83SPiotr Jasiukajtis #undef	signbit
10525c28e83SPiotr Jasiukajtis #if defined(_BIG_ENDIAN)
10625c28e83SPiotr Jasiukajtis #define	signbit(x)	__extension__( \
10725c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_s = (x); \
1089938df9eSRichard Lowe 			(int)(*(unsigned *)&__x_s >> 31); })
10925c28e83SPiotr Jasiukajtis #elif defined(_LITTLE_ENDIAN)
11025c28e83SPiotr Jasiukajtis #define	signbit(x)	__extension__( \
11125c28e83SPiotr Jasiukajtis 			{ __typeof(x) __x_s = (x); \
11225c28e83SPiotr Jasiukajtis 			(sizeof (__x_s) == sizeof (float) ? \
1139938df9eSRichard Lowe 			(int)(*(unsigned *)&__x_s >> 31) : \
11425c28e83SPiotr Jasiukajtis 			sizeof (__x_s) == sizeof (double) ? \
1159938df9eSRichard Lowe 			(int)(((unsigned *)&__x_s)[1] >> 31) : \
1169938df9eSRichard Lowe 			(int)(((unsigned short *)&__x_s)[4] >> 15)); })
117f26364c9SRichard Lowe #endif	/* defined(_BIG_ENDIAN) */
118f26364c9SRichard Lowe #endif	/* __GNUC__ >= 4 */
11925c28e83SPiotr Jasiukajtis 
12025c28e83SPiotr Jasiukajtis /*
12125c28e83SPiotr Jasiukajtis  * C99 7.12.14 comparison macros
12225c28e83SPiotr Jasiukajtis  */
12325c28e83SPiotr Jasiukajtis #undef	isgreater
12425c28e83SPiotr Jasiukajtis #define	isgreater(x, y)		__builtin_isgreater(x, y)
12525c28e83SPiotr Jasiukajtis #undef	isgreaterequal
12625c28e83SPiotr Jasiukajtis #define	isgreaterequal(x, y)	__builtin_isgreaterequal(x, y)
12725c28e83SPiotr Jasiukajtis #undef	isless
12825c28e83SPiotr Jasiukajtis #define	isless(x, y)		__builtin_isless(x, y)
12925c28e83SPiotr Jasiukajtis #undef	islessequal
13025c28e83SPiotr Jasiukajtis #define	islessequal(x, y)	__builtin_islessequal(x, y)
13125c28e83SPiotr Jasiukajtis #undef	islessgreater
13225c28e83SPiotr Jasiukajtis #define	islessgreater(x, y)	__builtin_islessgreater(x, y)
13325c28e83SPiotr Jasiukajtis #undef	isunordered
13425c28e83SPiotr Jasiukajtis #define	isunordered(x, y)	__builtin_isunordered(x, y)
13525c28e83SPiotr Jasiukajtis #else	/* defined(__GNUC__) */
13625c28e83SPiotr Jasiukajtis #undef	HUGE_VAL
13725c28e83SPiotr Jasiukajtis #define	HUGE_VAL	__builtin_huge_val
13825c28e83SPiotr Jasiukajtis #undef	HUGE_VALF
13925c28e83SPiotr Jasiukajtis #define	HUGE_VALF	__builtin_huge_valf
14025c28e83SPiotr Jasiukajtis #undef	HUGE_VALL
14125c28e83SPiotr Jasiukajtis #define	HUGE_VALL	__builtin_huge_vall
14225c28e83SPiotr Jasiukajtis #undef	INFINITY
14325c28e83SPiotr Jasiukajtis #define	INFINITY	__builtin_infinity
14425c28e83SPiotr Jasiukajtis #undef	NAN
14525c28e83SPiotr Jasiukajtis #define	NAN		__builtin_nan
14625c28e83SPiotr Jasiukajtis 
14725c28e83SPiotr Jasiukajtis /*
14825c28e83SPiotr Jasiukajtis  * C99 7.12.3 classification macros
14925c28e83SPiotr Jasiukajtis  */
15025c28e83SPiotr Jasiukajtis #undef	fpclassify
15125c28e83SPiotr Jasiukajtis #define	fpclassify(x)	__builtin_fpclassify(x)
15225c28e83SPiotr Jasiukajtis #undef	isfinite
15325c28e83SPiotr Jasiukajtis #define	isfinite(x)	__builtin_isfinite(x)
15425c28e83SPiotr Jasiukajtis #undef	isinf
15525c28e83SPiotr Jasiukajtis #define	isinf(x)	__builtin_isinf(x)
15625c28e83SPiotr Jasiukajtis #undef	isnan
15725c28e83SPiotr Jasiukajtis #define	isnan(x)	__builtin_isnan(x)
15825c28e83SPiotr Jasiukajtis #undef	isnormal
15925c28e83SPiotr Jasiukajtis #define	isnormal(x)	__builtin_isnormal(x)
16025c28e83SPiotr Jasiukajtis #undef	signbit
16125c28e83SPiotr Jasiukajtis #define	signbit(x)	__builtin_signbit(x)
16225c28e83SPiotr Jasiukajtis 
16325c28e83SPiotr Jasiukajtis /*
16425c28e83SPiotr Jasiukajtis  * C99 7.12.14 comparison macros
16525c28e83SPiotr Jasiukajtis  */
16625c28e83SPiotr Jasiukajtis #undef	isgreater
16725c28e83SPiotr Jasiukajtis #define	isgreater(x, y)		((x) __builtin_isgreater(y))
16825c28e83SPiotr Jasiukajtis #undef	isgreaterequal
16925c28e83SPiotr Jasiukajtis #define	isgreaterequal(x, y)	((x) __builtin_isgreaterequal(y))
17025c28e83SPiotr Jasiukajtis #undef	isless
17125c28e83SPiotr Jasiukajtis #define	isless(x, y)		((x) __builtin_isless(y))
17225c28e83SPiotr Jasiukajtis #undef	islessequal
17325c28e83SPiotr Jasiukajtis #define	islessequal(x, y)	((x) __builtin_islessequal(y))
17425c28e83SPiotr Jasiukajtis #undef	islessgreater
17525c28e83SPiotr Jasiukajtis #define	islessgreater(x, y)	((x) __builtin_islessgreater(y))
17625c28e83SPiotr Jasiukajtis #undef	isunordered
17725c28e83SPiotr Jasiukajtis #define	isunordered(x, y)	((x) __builtin_isunordered(y))
17825c28e83SPiotr Jasiukajtis #endif	/* defined(__GNUC__) */
17925c28e83SPiotr Jasiukajtis #endif	/* defined(_STDC_C99) || _XOPEN_SOURCE - 0 >= 600 || ... */
18025c28e83SPiotr Jasiukajtis 
18125c28e83SPiotr Jasiukajtis #if defined(__EXTENSIONS__) || defined(_STDC_C99) || \
18225c28e83SPiotr Jasiukajtis 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
18325c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
18425c28e83SPiotr Jasiukajtis #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ - 0 == 0
18525c28e83SPiotr Jasiukajtis typedef float float_t;
18625c28e83SPiotr Jasiukajtis typedef double double_t;
18725c28e83SPiotr Jasiukajtis #elif __FLT_EVAL_METHOD__ - 0 == 1
18825c28e83SPiotr Jasiukajtis typedef double float_t;
18925c28e83SPiotr Jasiukajtis typedef double double_t;
19025c28e83SPiotr Jasiukajtis #elif __FLT_EVAL_METHOD__ - 0 == 2
19125c28e83SPiotr Jasiukajtis typedef long double float_t;
19225c28e83SPiotr Jasiukajtis typedef long double double_t;
19325c28e83SPiotr Jasiukajtis #elif defined(__sparc) || defined(__amd64)
19425c28e83SPiotr Jasiukajtis typedef float float_t;
19525c28e83SPiotr Jasiukajtis typedef double double_t;
19625c28e83SPiotr Jasiukajtis #elif defined(__i386)
19725c28e83SPiotr Jasiukajtis typedef long double float_t;
19825c28e83SPiotr Jasiukajtis typedef long double double_t;
19925c28e83SPiotr Jasiukajtis #endif
20025c28e83SPiotr Jasiukajtis 
20125c28e83SPiotr Jasiukajtis #undef	FP_ILOGB0
20225c28e83SPiotr Jasiukajtis #define	FP_ILOGB0	(-2147483647)
20325c28e83SPiotr Jasiukajtis #undef	FP_ILOGBNAN
20425c28e83SPiotr Jasiukajtis #define	FP_ILOGBNAN	2147483647
20525c28e83SPiotr Jasiukajtis 
20625c28e83SPiotr Jasiukajtis #undef	MATH_ERRNO
20725c28e83SPiotr Jasiukajtis #define	MATH_ERRNO	1
20825c28e83SPiotr Jasiukajtis #undef	MATH_ERREXCEPT
20925c28e83SPiotr Jasiukajtis #define	MATH_ERREXCEPT	2
21025c28e83SPiotr Jasiukajtis #undef	math_errhandling
21125c28e83SPiotr Jasiukajtis #define	math_errhandling	MATH_ERREXCEPT
21225c28e83SPiotr Jasiukajtis 
2139938df9eSRichard Lowe extern double acosh(double);
2149938df9eSRichard Lowe extern double asinh(double);
2159938df9eSRichard Lowe extern double atanh(double);
2169938df9eSRichard Lowe 
2179938df9eSRichard Lowe extern double exp2(double);
2189938df9eSRichard Lowe extern double expm1(double);
2199938df9eSRichard Lowe extern int ilogb(double);
2209938df9eSRichard Lowe extern double log1p(double);
2219938df9eSRichard Lowe extern double log2(double);
2229938df9eSRichard Lowe extern double logb(double);
2239938df9eSRichard Lowe extern double scalbn(double, int);
2249938df9eSRichard Lowe extern double scalbln(double, long int);
2259938df9eSRichard Lowe 
2269938df9eSRichard Lowe extern double cbrt(double);
2279938df9eSRichard Lowe extern double hypot(double, double);
2289938df9eSRichard Lowe 
2299938df9eSRichard Lowe extern double erf(double);
2309938df9eSRichard Lowe extern double erfc(double);
2319938df9eSRichard Lowe extern double lgamma(double);
2329938df9eSRichard Lowe extern double tgamma(double);
2339938df9eSRichard Lowe 
2349938df9eSRichard Lowe extern double nearbyint(double);
2359938df9eSRichard Lowe extern double rint(double);
2369938df9eSRichard Lowe extern long int lrint(double);
2379938df9eSRichard Lowe extern double round(double);
2389938df9eSRichard Lowe extern long int lround(double);
2399938df9eSRichard Lowe extern double trunc(double);
2409938df9eSRichard Lowe 
2419938df9eSRichard Lowe extern double remainder(double, double);
2429938df9eSRichard Lowe extern double remquo(double, double, int *);
2439938df9eSRichard Lowe 
2449938df9eSRichard Lowe extern double copysign(double, double);
2459938df9eSRichard Lowe extern double nan(const char *);
2469938df9eSRichard Lowe extern double nextafter(double, double);
2479938df9eSRichard Lowe extern double nexttoward(double, long double);
2489938df9eSRichard Lowe 
2499938df9eSRichard Lowe extern double fdim(double, double);
2509938df9eSRichard Lowe extern double fmax(double, double);
2519938df9eSRichard Lowe extern double fmin(double, double);
2529938df9eSRichard Lowe 
2539938df9eSRichard Lowe extern double fma(double, double, double);
2549938df9eSRichard Lowe 
2559938df9eSRichard Lowe extern float acosf(float);
2569938df9eSRichard Lowe extern float asinf(float);
2579938df9eSRichard Lowe extern float atanf(float);
2589938df9eSRichard Lowe extern float atan2f(float, float);
2599938df9eSRichard Lowe extern float cosf(float);
2609938df9eSRichard Lowe extern float sinf(float);
2619938df9eSRichard Lowe extern float tanf(float);
2629938df9eSRichard Lowe 
2639938df9eSRichard Lowe extern float acoshf(float);
2649938df9eSRichard Lowe extern float asinhf(float);
2659938df9eSRichard Lowe extern float atanhf(float);
2669938df9eSRichard Lowe extern float coshf(float);
2679938df9eSRichard Lowe extern float sinhf(float);
2689938df9eSRichard Lowe extern float tanhf(float);
2699938df9eSRichard Lowe 
2709938df9eSRichard Lowe extern float expf(float);
2719938df9eSRichard Lowe extern float exp2f(float);
2729938df9eSRichard Lowe extern float expm1f(float);
2739938df9eSRichard Lowe extern float frexpf(float, int *);
2749938df9eSRichard Lowe extern int ilogbf(float);
2759938df9eSRichard Lowe extern float ldexpf(float, int);
2769938df9eSRichard Lowe extern float logf(float);
2779938df9eSRichard Lowe extern float log10f(float);
2789938df9eSRichard Lowe extern float log1pf(float);
2799938df9eSRichard Lowe extern float log2f(float);
2809938df9eSRichard Lowe extern float logbf(float);
2819938df9eSRichard Lowe extern float modff(float, float *);
2829938df9eSRichard Lowe extern float scalbnf(float, int);
2839938df9eSRichard Lowe extern float scalblnf(float, long int);
2849938df9eSRichard Lowe 
2859938df9eSRichard Lowe extern float cbrtf(float);
2869938df9eSRichard Lowe extern float fabsf(float);
2879938df9eSRichard Lowe extern float hypotf(float, float);
2889938df9eSRichard Lowe extern float powf(float, float);
2899938df9eSRichard Lowe extern float sqrtf(float);
2909938df9eSRichard Lowe 
2919938df9eSRichard Lowe extern float erff(float);
2929938df9eSRichard Lowe extern float erfcf(float);
2939938df9eSRichard Lowe extern float lgammaf(float);
2949938df9eSRichard Lowe extern float tgammaf(float);
2959938df9eSRichard Lowe 
2969938df9eSRichard Lowe extern float ceilf(float);
2979938df9eSRichard Lowe extern float floorf(float);
2989938df9eSRichard Lowe extern float nearbyintf(float);
2999938df9eSRichard Lowe extern float rintf(float);
3009938df9eSRichard Lowe extern long int lrintf(float);
3019938df9eSRichard Lowe extern float roundf(float);
3029938df9eSRichard Lowe extern long int lroundf(float);
3039938df9eSRichard Lowe extern float truncf(float);
3049938df9eSRichard Lowe 
3059938df9eSRichard Lowe extern float fmodf(float, float);
3069938df9eSRichard Lowe extern float remainderf(float, float);
3079938df9eSRichard Lowe extern float remquof(float, float, int *);
3089938df9eSRichard Lowe 
3099938df9eSRichard Lowe extern float copysignf(float, float);
3109938df9eSRichard Lowe extern float nanf(const char *);
3119938df9eSRichard Lowe extern float nextafterf(float, float);
3129938df9eSRichard Lowe extern float nexttowardf(float, long double);
3139938df9eSRichard Lowe 
3149938df9eSRichard Lowe extern float fdimf(float, float);
3159938df9eSRichard Lowe extern float fmaxf(float, float);
3169938df9eSRichard Lowe extern float fminf(float, float);
3179938df9eSRichard Lowe 
3189938df9eSRichard Lowe extern float fmaf(float, float, float);
3199938df9eSRichard Lowe 
3209938df9eSRichard Lowe extern long double acosl(long double);
3219938df9eSRichard Lowe extern long double asinl(long double);
3229938df9eSRichard Lowe extern long double atanl(long double);
3239938df9eSRichard Lowe extern long double atan2l(long double, long double);
3249938df9eSRichard Lowe extern long double cosl(long double);
3259938df9eSRichard Lowe extern long double sinl(long double);
3269938df9eSRichard Lowe extern long double tanl(long double);
3279938df9eSRichard Lowe 
3289938df9eSRichard Lowe extern long double acoshl(long double);
3299938df9eSRichard Lowe extern long double asinhl(long double);
3309938df9eSRichard Lowe extern long double atanhl(long double);
3319938df9eSRichard Lowe extern long double coshl(long double);
3329938df9eSRichard Lowe extern long double sinhl(long double);
3339938df9eSRichard Lowe extern long double tanhl(long double);
3349938df9eSRichard Lowe 
3359938df9eSRichard Lowe extern long double expl(long double);
3369938df9eSRichard Lowe extern long double exp2l(long double);
3379938df9eSRichard Lowe extern long double expm1l(long double);
3389938df9eSRichard Lowe extern long double frexpl(long double, int *);
3399938df9eSRichard Lowe extern int ilogbl(long double);
3409938df9eSRichard Lowe extern long double ldexpl(long double, int);
3419938df9eSRichard Lowe extern long double logl(long double);
3429938df9eSRichard Lowe extern long double log10l(long double);
3439938df9eSRichard Lowe extern long double log1pl(long double);
3449938df9eSRichard Lowe extern long double log2l(long double);
3459938df9eSRichard Lowe extern long double logbl(long double);
3469938df9eSRichard Lowe extern long double modfl(long double, long double *);
3479938df9eSRichard Lowe extern long double scalbnl(long double, int);
3489938df9eSRichard Lowe extern long double scalblnl(long double, long int);
3499938df9eSRichard Lowe 
3509938df9eSRichard Lowe extern long double cbrtl(long double);
3519938df9eSRichard Lowe extern long double fabsl(long double);
3529938df9eSRichard Lowe extern long double hypotl(long double, long double);
3539938df9eSRichard Lowe extern long double powl(long double, long double);
3549938df9eSRichard Lowe extern long double sqrtl(long double);
3559938df9eSRichard Lowe 
3569938df9eSRichard Lowe extern long double erfl(long double);
3579938df9eSRichard Lowe extern long double erfcl(long double);
3589938df9eSRichard Lowe extern long double lgammal(long double);
3599938df9eSRichard Lowe extern long double tgammal(long double);
3609938df9eSRichard Lowe 
3619938df9eSRichard Lowe extern long double ceill(long double);
3629938df9eSRichard Lowe extern long double floorl(long double);
3639938df9eSRichard Lowe extern long double nearbyintl(long double);
3649938df9eSRichard Lowe extern long double rintl(long double);
3659938df9eSRichard Lowe extern long int lrintl(long double);
3669938df9eSRichard Lowe extern long double roundl(long double);
3679938df9eSRichard Lowe extern long int lroundl(long double);
3689938df9eSRichard Lowe extern long double truncl(long double);
3699938df9eSRichard Lowe 
3709938df9eSRichard Lowe extern long double fmodl(long double, long double);
3719938df9eSRichard Lowe extern long double remainderl(long double, long double);
3729938df9eSRichard Lowe extern long double remquol(long double, long double, int *);
3739938df9eSRichard Lowe 
3749938df9eSRichard Lowe extern long double copysignl(long double, long double);
3759938df9eSRichard Lowe extern long double nanl(const char *);
3769938df9eSRichard Lowe extern long double nextafterl(long double, long double);
3779938df9eSRichard Lowe extern long double nexttowardl(long double, long double);
3789938df9eSRichard Lowe 
3799938df9eSRichard Lowe extern long double fdiml(long double, long double);
3809938df9eSRichard Lowe extern long double fmaxl(long double, long double);
3819938df9eSRichard Lowe extern long double fminl(long double, long double);
3829938df9eSRichard Lowe 
3839938df9eSRichard Lowe extern long double fmal(long double, long double, long double);
38425c28e83SPiotr Jasiukajtis 
38525c28e83SPiotr Jasiukajtis #if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
38625c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
3879938df9eSRichard Lowe extern long long int llrint(double);
3889938df9eSRichard Lowe extern long long int llround(double);
38925c28e83SPiotr Jasiukajtis 
3909938df9eSRichard Lowe extern long long int llrintf(float);
3919938df9eSRichard Lowe extern long long int llroundf(float);
39225c28e83SPiotr Jasiukajtis 
3939938df9eSRichard Lowe extern long long int llrintl(long double);
3949938df9eSRichard Lowe extern long long int llroundl(long double);
39525c28e83SPiotr Jasiukajtis #endif
39625c28e83SPiotr Jasiukajtis 
39725c28e83SPiotr Jasiukajtis #if !defined(__cplusplus)
39825c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(asinh, exp2, expm1)
39925c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ilogb, log2)
40025c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(scalbn, scalbln, cbrt)
40125c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(erf, erfc, tgamma)
40225c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(nearbyint, rint, lrint, round, lround, trunc)
40325c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(remquo)
40425c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(copysign, nan, nexttoward)
40525c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fdim, fmax, fmin, fma)
40625c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(asinh, exp2, expm1)
40725c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ilogb, log2)
40825c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(scalbn, scalbln, cbrt)
40925c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(erf, erfc, tgamma)
41025c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(nearbyint, rint, lrint, round, lround, trunc)
41125c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(copysign, nan, nexttoward)
41225c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fdim, fmax, fmin, fma)
41325c28e83SPiotr Jasiukajtis 
41425c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acosf, asinf, atanf, atan2f)
41525c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cosf, sinf, tanf)
41625c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acoshf, asinhf, atanhf, coshf, sinhf, tanhf)
41725c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(expf, exp2f, expm1f, frexpf, ilogbf, ldexpf)
41825c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(logf, log10f, log1pf, log2f, logbf)
41925c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(modff, scalbnf, scalblnf)
42025c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cbrtf, fabsf, hypotf, powf, sqrtf)
42125c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(erff, erfcf, lgammaf, tgammaf)
42225c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ceilf, floorf, nearbyintf)
42325c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(rintf, lrintf, roundf, lroundf, truncf)
42425c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fmodf, remainderf, remquof)
42525c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(copysignf, nanf, nextafterf, nexttowardf)
42625c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fdimf, fmaxf, fminf, fmaf)
42725c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acosf, asinf, atanf, atan2f)
42825c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cosf, sinf, tanf)
42925c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acoshf, asinhf, atanhf, coshf, sinhf, tanhf)
43025c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(expf, exp2f, expm1f, ilogbf, ldexpf)
43125c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(logf, log10f, log1pf, log2f, logbf)
43225c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cbrtf, fabsf, hypotf, powf, sqrtf)
43325c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(erff, erfcf, tgammaf)
43425c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ceilf, floorf, nearbyintf)
43525c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(rintf, lrintf, roundf, lroundf, truncf)
43625c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fmodf, remainderf)
43725c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(copysignf, nanf, nextafterf, nexttowardf)
43825c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fdimf, fmaxf, fminf, fmaf)
43925c28e83SPiotr Jasiukajtis 
44025c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acosl, asinl, atanl, atan2l)
44125c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cosl, sinl, tanl)
44225c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acoshl, asinhl, atanhl, coshl, sinhl, tanhl)
44325c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(expl, exp2l, expm1l, frexpl, ilogbl, ldexpl)
44425c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(logl, log10l, log1pl, log2l, logbl)
44525c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(modfl, scalbnl, scalblnl)
44625c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cbrtl, fabsl, hypotl, powl, sqrtl)
44725c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(erfl, erfcl, lgammal, tgammal)
44825c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ceill, floorl, nearbyintl)
44925c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(rintl, lrintl, roundl, lroundl, truncl)
45025c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fmodl, remainderl, remquol)
45125c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(copysignl, nanl, nextafterl, nexttowardl)
45225c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(fdiml, fmaxl, fminl, fmal)
45325c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acosl, asinl, atanl, atan2l)
45425c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cosl, sinl, tanl)
45525c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acoshl, asinhl, atanhl, coshl, sinhl, tanhl)
45625c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(expl, exp2l, expm1l, ilogbl, ldexpl)
45725c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(logl, log10l, log1pl, log2l, logbl)
45825c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cbrtl, fabsl, hypotl, powl, sqrtl)
45925c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(erfl, erfcl, tgammal)
46025c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ceill, floorl, nearbyintl)
46125c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(rintl, lrintl, roundl, lroundl, truncl)
46225c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fmodl, remainderl)
46325c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(copysignl, nanl, nextafterl, nexttowardl)
46425c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(fdiml, fmaxl, fminl, fmal)
46525c28e83SPiotr Jasiukajtis 
46625c28e83SPiotr Jasiukajtis #if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
46725c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
46825c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(llrint, llround)
46925c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(llrintf, llroundf, llrintl, llroundl)
47025c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(llrint, llround)
47125c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(llrintf, llroundf, llrintl, llroundl)
47225c28e83SPiotr Jasiukajtis #endif
47325c28e83SPiotr Jasiukajtis #endif	/* !defined(__cplusplus) */
47425c28e83SPiotr Jasiukajtis 
47525c28e83SPiotr Jasiukajtis #if defined(__MATHERR_ERRNO_DONTCARE)
47625c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acosh, atanh, hypot, lgamma, log1p, logb)
47725c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(nextafter, remainder)
47825c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acosh, atanh, hypot, log1p, logb)
47925c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(nextafter, remainder)
48025c28e83SPiotr Jasiukajtis 
48125c28e83SPiotr Jasiukajtis #pragma no_side_effect(acosh, asinh, atanh, exp2, expm1)
48225c28e83SPiotr Jasiukajtis #pragma no_side_effect(ilogb, log1p, log2, logb)
48325c28e83SPiotr Jasiukajtis #pragma no_side_effect(scalbn, scalbln, cbrt, hypot)
48425c28e83SPiotr Jasiukajtis #pragma no_side_effect(erf, erfc, tgamma)
48525c28e83SPiotr Jasiukajtis #pragma no_side_effect(nearbyint, rint, lrint, round, lround, trunc)
48625c28e83SPiotr Jasiukajtis #pragma no_side_effect(remainder)
48725c28e83SPiotr Jasiukajtis #pragma no_side_effect(copysign, nan, nextafter, nexttoward)
48825c28e83SPiotr Jasiukajtis #pragma no_side_effect(fdim, fmax, fmin, fma)
48925c28e83SPiotr Jasiukajtis 
49025c28e83SPiotr Jasiukajtis #pragma no_side_effect(acosf, asinf, atanf, atan2f)
49125c28e83SPiotr Jasiukajtis #pragma no_side_effect(cosf, sinf, tanf, coshf, sinhf, tanhf)
49225c28e83SPiotr Jasiukajtis #pragma no_side_effect(acoshf, asinhf, atanhf, coshf, sinhf, tanhf)
49325c28e83SPiotr Jasiukajtis #pragma no_side_effect(expf, exp2f, expm1f, ilogbf, ldexpf)
49425c28e83SPiotr Jasiukajtis #pragma no_side_effect(logf, log10f, log1pf, log2f, logbf)
49525c28e83SPiotr Jasiukajtis #pragma no_side_effect(cbrtf, fabsf, hypotf, powf, sqrtf)
49625c28e83SPiotr Jasiukajtis #pragma no_side_effect(erff, erfcf, tgammaf)
49725c28e83SPiotr Jasiukajtis #pragma no_side_effect(ceilf, floorf, nearbyintf)
49825c28e83SPiotr Jasiukajtis #pragma no_side_effect(rintf, lrintf, roundf, lroundf, truncf)
49925c28e83SPiotr Jasiukajtis #pragma no_side_effect(fmodf, remainderf)
50025c28e83SPiotr Jasiukajtis #pragma no_side_effect(copysignf, nanf, nextafterf, nexttowardf)
50125c28e83SPiotr Jasiukajtis #pragma no_side_effect(fdimf, fmaxf, fminf, fmaf)
50225c28e83SPiotr Jasiukajtis 
50325c28e83SPiotr Jasiukajtis #pragma no_side_effect(acosl, asinl, atanl, atan2l)
50425c28e83SPiotr Jasiukajtis #pragma no_side_effect(cosl, sinl, tanl, coshl, sinhl, tanhl)
50525c28e83SPiotr Jasiukajtis #pragma no_side_effect(acoshl, asinhl, atanhl, coshl, sinhl, tanhl)
50625c28e83SPiotr Jasiukajtis #pragma no_side_effect(expl, exp2l, expm1l, ilogbl, ldexpl)
50725c28e83SPiotr Jasiukajtis #pragma no_side_effect(logl, log10l, log1pl, log2l, logbl)
50825c28e83SPiotr Jasiukajtis #pragma no_side_effect(cbrtl, fabsl, hypotl, powl, sqrtl)
50925c28e83SPiotr Jasiukajtis #pragma no_side_effect(erfl, erfcl, tgammal)
51025c28e83SPiotr Jasiukajtis #pragma no_side_effect(ceill, floorl, nearbyintl)
51125c28e83SPiotr Jasiukajtis #pragma no_side_effect(rintl, lrintl, roundl, lroundl, truncl)
51225c28e83SPiotr Jasiukajtis #pragma no_side_effect(fmodl, remainderl)
51325c28e83SPiotr Jasiukajtis #pragma no_side_effect(copysignl, nanl, nextafterl, nexttowardl)
51425c28e83SPiotr Jasiukajtis #pragma no_side_effect(fdiml, fmaxl, fminl, fmal)
51525c28e83SPiotr Jasiukajtis 
51625c28e83SPiotr Jasiukajtis #if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
51725c28e83SPiotr Jasiukajtis 	defined(__C99FEATURES__)
51825c28e83SPiotr Jasiukajtis #pragma no_side_effect(llrint, llround, llrintf, llroundf, llrintl, llroundl)
51925c28e83SPiotr Jasiukajtis #endif
52025c28e83SPiotr Jasiukajtis #endif	/* defined(__MATHERR_ERRNO_DONTCARE) */
52125c28e83SPiotr Jasiukajtis #endif	/* defined(__EXTENSIONS__) || defined(_STDC_C99) || ... */
52225c28e83SPiotr Jasiukajtis 
52325c28e83SPiotr Jasiukajtis #ifdef __cplusplus
52425c28e83SPiotr Jasiukajtis }
52525c28e83SPiotr Jasiukajtis #endif
52625c28e83SPiotr Jasiukajtis 
52725c28e83SPiotr Jasiukajtis #endif	/* _ISO_MATH_C99_H */