18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _ISO_MATH_ISO_H
30 #define _ISO_MATH_ISO_H
31
32 #include <sys/feature_tests.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #ifndef __P
39 #ifdef __STDC__
40 #define __P(p) p
41 #else
42 #define __P(p) ()
43 #endif
44 #endif /* !defined(__P) */
45
46 #if !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && !defined(__C99FEATURES__)
47 typedef union _h_val {
48 unsigned long _i[sizeof (double) / sizeof (unsigned long)];
49 double _d;
50 } _h_val;
51
52 #ifdef __STDC__
53 extern const _h_val __huge_val;
54 #else
55 extern _h_val __huge_val;
56 #endif
57 #undef HUGE_VAL
58 #define HUGE_VAL __huge_val._d
59 #endif /* !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && ... */
60
61 #if __cplusplus >= 199711L
62 namespace std {
63 #endif
64
65 extern double acos __P((double));
66 extern double asin __P((double));
67 extern double atan __P((double));
68 extern double atan2 __P((double, double));
69 extern double cos __P((double));
70 extern double sin __P((double));
71 extern double tan __P((double));
72
73 extern double cosh __P((double));
74 extern double sinh __P((double));
75 extern double tanh __P((double));
76
77 extern double exp __P((double));
78 extern double frexp __P((double, int *));
79 extern double ldexp __P((double, int));
80 extern double log __P((double));
81 extern double log10 __P((double));
82 extern double modf __P((double, double *));
83
84 extern double pow __P((double, double));
85 extern double sqrt __P((double));
86
87 extern double ceil __P((double));
88 extern double fabs __P((double));
89 extern double floor __P((double));
90 extern double fmod __P((double, double));
91
92 #if defined(__MATHERR_ERRNO_DONTCARE)
93 #pragma does_not_read_global_data(acos, asin, atan, atan2)
94 #pragma does_not_read_global_data(cos, sin, tan, cosh, sinh, tanh)
95 #pragma does_not_read_global_data(exp, log, log10, pow, sqrt)
96 #pragma does_not_read_global_data(frexp, ldexp, modf)
97 #pragma does_not_read_global_data(ceil, fabs, floor, fmod)
98 #pragma does_not_write_global_data(acos, asin, atan, atan2)
99 #pragma does_not_write_global_data(cos, sin, tan, cosh, sinh, tanh)
100 #pragma does_not_write_global_data(exp, log, log10, pow, sqrt)
101 #pragma does_not_write_global_data(ldexp)
102 #pragma does_not_write_global_data(ceil, fabs, floor, fmod)
103 #pragma no_side_effect(acos, asin, atan, atan2)
104 #pragma no_side_effect(cos, sin, tan, cosh, sinh, tanh)
105 #pragma no_side_effect(exp, log, log10, pow, sqrt)
106 #pragma no_side_effect(ldexp)
107 #pragma no_side_effect(ceil, fabs, floor, fmod)
108 #endif
109
110 #if __cplusplus >= 199711L
141 extern long double __expl(long double);
142 extern long double __fabsl(long double);
143 extern long double __floorl(long double);
144 extern long double __fmodl(long double, long double);
145 extern long double __frexpl(long double, int *);
146 extern long double __ldexpl(long double, int);
147 extern long double __logl(long double);
148 extern long double __log10l(long double);
149 extern long double __modfl(long double, long double *);
150 extern long double __powl(long double, long double);
151 extern long double __sinl(long double);
152 extern long double __sinhl(long double);
153 extern long double __sqrtl(long double);
154 extern long double __tanl(long double);
155 extern long double __tanhl(long double);
156
157 extern "C++" {
158 #undef __X
159 #undef __Y
160 inline double abs(double __X) { return fabs(__X); }
161 inline double pow(double __X, int __Y) { return
162 pow(__X, (double) (__Y)); }
163
164 inline float abs(float __X) { return __fabsf(__X); }
165 inline float acos(float __X) { return __acosf(__X); }
166 inline float asin(float __X) { return __asinf(__X); }
167 inline float atan(float __X) { return __atanf(__X); }
168 inline float atan2(float __X, float __Y) { return __atan2f(__X, __Y); }
169 inline float ceil(float __X) { return __ceilf(__X); }
170 inline float cos(float __X) { return __cosf(__X); }
171 inline float cosh(float __X) { return __coshf(__X); }
172 inline float exp(float __X) { return __expf(__X); }
173 inline float fabs(float __X) { return __fabsf(__X); }
174 inline float floor(float __X) { return __floorf(__X); }
175 inline float fmod(float __X, float __Y) { return __fmodf(__X, __Y); }
176 inline float frexp(float __X, int *__Y) { return __frexpf(__X, __Y); }
177 inline float ldexp(float __X, int __Y) { return __ldexpf(__X, __Y); }
178 inline float log(float __X) { return __logf(__X); }
179 inline float log10(float __X) { return __log10f(__X); }
180 inline float modf(float __X, float *__Y) { return __modff(__X, __Y); }
181 inline float pow(float __X, float __Y) { return __powf(__X, __Y); }
182 inline float pow(float __X, int __Y) { return
183 pow((double) (__X), (double) (__Y)); }
184 inline float sin(float __X) { return __sinf(__X); }
185 inline float sinh(float __X) { return __sinhf(__X); }
186 inline float sqrt(float __X) { return __sqrtf(__X); }
187 inline float tan(float __X) { return __tanf(__X); }
188 inline float tanh(float __X) { return __tanhf(__X); }
189
190 inline long double abs(long double __X) { return __fabsl(__X); }
191 inline long double acos(long double __X) { return __acosl(__X); }
192 inline long double asin(long double __X) { return __asinl(__X); }
193 inline long double atan(long double __X) { return __atanl(__X); }
194 inline long double atan2(long double __X, long double __Y) { return
195 __atan2l(__X, __Y); }
196 inline long double ceil(long double __X) { return __ceill(__X); }
197 inline long double cos(long double __X) { return __cosl(__X); }
198 inline long double cosh(long double __X) { return __coshl(__X); }
199 inline long double exp(long double __X) { return __expl(__X); }
200 inline long double fabs(long double __X) { return __fabsl(__X); }
201 inline long double floor(long double __X) { return __floorl(__X); }
202 inline long double fmod(long double __X, long double __Y) { return
203 __fmodl(__X, __Y); }
204 inline long double frexp(long double __X, int *__Y) { return
205 __frexpl(__X, __Y); }
206 inline long double ldexp(long double __X, int __Y) { return
207 __ldexpl(__X, __Y); }
208 inline long double log(long double __X) { return __logl(__X); }
209 inline long double log10(long double __X) { return __log10l(__X); }
210 inline long double modf(long double __X, long double *__Y) { return
211 __modfl(__X, __Y); }
212 inline long double pow(long double __X, long double __Y) { return
213 __powl(__X, __Y); }
214 inline long double pow(long double __X, int __Y) { return
215 __powl(__X, (long double) (__Y)); }
216 inline long double sin(long double __X) { return __sinl(__X); }
217 inline long double sinh(long double __X) { return __sinhl(__X); }
218 inline long double sqrt(long double __X) { return __sqrtl(__X); }
219 inline long double tan(long double __X) { return __tanl(__X); }
220 inline long double tanh(long double __X) { return __tanhl(__X); }
221 } /* end of extern "C++" */
222 #endif /* __cplusplus >= 199711L */
223
224 #if __cplusplus >= 199711L
225 } /* end of namespace std */
226 #endif
227
228 #ifdef __cplusplus
229 }
230 #endif
231
232 #endif /* _ISO_MATH_ISO_H */
|
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _ISO_MATH_ISO_H
30 #define _ISO_MATH_ISO_H
31
32 #include <sys/feature_tests.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #if !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && !defined(__C99FEATURES__)
39 typedef union _h_val {
40 unsigned long _i[sizeof (double) / sizeof (unsigned long)];
41 double _d;
42 } _h_val;
43
44 #ifdef __STDC__
45 extern const _h_val __huge_val;
46 #else
47 extern _h_val __huge_val;
48 #endif
49 #undef HUGE_VAL
50 #define HUGE_VAL __huge_val._d
51 #endif /* !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && ... */
52
53 #if __cplusplus >= 199711L
54 namespace std {
55 #endif
56
57 extern double acos(double);
58 extern double asin(double);
59 extern double atan(double);
60 extern double atan2(double, double);
61 extern double cos(double);
62 extern double sin(double);
63 extern double tan(double);
64
65 extern double cosh(double);
66 extern double sinh(double);
67 extern double tanh(double);
68
69 extern double exp(double);
70 extern double frexp(double, int *);
71 extern double ldexp(double, int);
72 extern double log(double);
73 extern double log10(double);
74 extern double modf(double, double *);
75
76 extern double pow(double, double);
77 extern double sqrt(double);
78
79 extern double ceil(double);
80 extern double fabs(double);
81 extern double floor(double);
82 extern double fmod(double, double);
83
84 #if defined(__MATHERR_ERRNO_DONTCARE)
85 #pragma does_not_read_global_data(acos, asin, atan, atan2)
86 #pragma does_not_read_global_data(cos, sin, tan, cosh, sinh, tanh)
87 #pragma does_not_read_global_data(exp, log, log10, pow, sqrt)
88 #pragma does_not_read_global_data(frexp, ldexp, modf)
89 #pragma does_not_read_global_data(ceil, fabs, floor, fmod)
90 #pragma does_not_write_global_data(acos, asin, atan, atan2)
91 #pragma does_not_write_global_data(cos, sin, tan, cosh, sinh, tanh)
92 #pragma does_not_write_global_data(exp, log, log10, pow, sqrt)
93 #pragma does_not_write_global_data(ldexp)
94 #pragma does_not_write_global_data(ceil, fabs, floor, fmod)
95 #pragma no_side_effect(acos, asin, atan, atan2)
96 #pragma no_side_effect(cos, sin, tan, cosh, sinh, tanh)
97 #pragma no_side_effect(exp, log, log10, pow, sqrt)
98 #pragma no_side_effect(ldexp)
99 #pragma no_side_effect(ceil, fabs, floor, fmod)
100 #endif
101
102 #if __cplusplus >= 199711L
133 extern long double __expl(long double);
134 extern long double __fabsl(long double);
135 extern long double __floorl(long double);
136 extern long double __fmodl(long double, long double);
137 extern long double __frexpl(long double, int *);
138 extern long double __ldexpl(long double, int);
139 extern long double __logl(long double);
140 extern long double __log10l(long double);
141 extern long double __modfl(long double, long double *);
142 extern long double __powl(long double, long double);
143 extern long double __sinl(long double);
144 extern long double __sinhl(long double);
145 extern long double __sqrtl(long double);
146 extern long double __tanl(long double);
147 extern long double __tanhl(long double);
148
149 extern "C++" {
150 #undef __X
151 #undef __Y
152 inline double abs(double __X) { return fabs(__X); }
153
154 inline double pow(double __X, int __Y) {
155 return (pow(__X, (double)(__Y)));
156 }
157
158 inline float abs(float __X) { return __fabsf(__X); }
159 inline float acos(float __X) { return __acosf(__X); }
160 inline float asin(float __X) { return __asinf(__X); }
161 inline float atan(float __X) { return __atanf(__X); }
162 inline float atan2(float __X, float __Y) { return __atan2f(__X, __Y); }
163 inline float ceil(float __X) { return __ceilf(__X); }
164 inline float cos(float __X) { return __cosf(__X); }
165 inline float cosh(float __X) { return __coshf(__X); }
166 inline float exp(float __X) { return __expf(__X); }
167 inline float fabs(float __X) { return __fabsf(__X); }
168 inline float floor(float __X) { return __floorf(__X); }
169 inline float fmod(float __X, float __Y) { return __fmodf(__X, __Y); }
170 inline float frexp(float __X, int *__Y) { return __frexpf(__X, __Y); }
171 inline float ldexp(float __X, int __Y) { return __ldexpf(__X, __Y); }
172 inline float log(float __X) { return __logf(__X); }
173 inline float log10(float __X) { return __log10f(__X); }
174 inline float modf(float __X, float *__Y) { return __modff(__X, __Y); }
175 inline float pow(float __X, float __Y) { return __powf(__X, __Y); }
176
177 inline float pow(float __X, int __Y) {
178 return (pow((double)(__X), (double)(__Y)));
179 }
180
181 inline float sin(float __X) { return __sinf(__X); }
182 inline float sinh(float __X) { return __sinhf(__X); }
183 inline float sqrt(float __X) { return __sqrtf(__X); }
184 inline float tan(float __X) { return __tanf(__X); }
185 inline float tanh(float __X) { return __tanhf(__X); }
186
187 inline long double abs(long double __X) { return __fabsl(__X); }
188 inline long double acos(long double __X) { return __acosl(__X); }
189 inline long double asin(long double __X) { return __asinl(__X); }
190 inline long double atan(long double __X) { return __atanl(__X); }
191
192 inline long double atan2(long double __X, long double __Y) {
193 return (__atan2l(__X, __Y));
194 }
195
196 inline long double ceil(long double __X) { return __ceill(__X); }
197 inline long double cos(long double __X) { return __cosl(__X); }
198 inline long double cosh(long double __X) { return __coshl(__X); }
199 inline long double exp(long double __X) { return __expl(__X); }
200 inline long double fabs(long double __X) { return __fabsl(__X); }
201 inline long double floor(long double __X) { return __floorl(__X); }
202
203 inline long double fmod(long double __X, long double __Y) {
204 return (__fmodl(__X, __Y));
205 }
206
207 inline long double frexp(long double __X, int *__Y) {
208 return (__frexpl(__X, __Y));
209 }
210
211 inline long double ldexp(long double __X, int __Y) {
212 return (__ldexpl(__X, __Y));
213 }
214
215 inline long double log(long double __X) { return __logl(__X); }
216 inline long double log10(long double __X) { return __log10l(__X); }
217
218 inline long double modf(long double __X, long double *__Y) {
219 return (__modfl(__X, __Y));
220 }
221
222 inline long double pow(long double __X, long double __Y) {
223 return (__powl(__X, __Y));
224 }
225
226 inline long double pow(long double __X, int __Y) {
227 return (__powl(__X, (long double) (__Y)));
228 }
229
230 inline long double sin(long double __X) { return __sinl(__X); }
231 inline long double sinh(long double __X) { return __sinhl(__X); }
232 inline long double sqrt(long double __X) { return __sqrtl(__X); }
233 inline long double tan(long double __X) { return __tanl(__X); }
234 inline long double tanh(long double __X) { return __tanhl(__X); }
235 } /* end of extern "C++" */
236 #endif /* __cplusplus >= 199711L */
237
238 #if __cplusplus >= 199711L
239 } /* end of namespace std */
240 #endif
241
242 #ifdef __cplusplus
243 }
244 #endif
245
246 #endif /* _ISO_MATH_ISO_H */
|