]>
Commit | Line | Data |
---|---|---|
34ff0b99 | 1 | // -*- C++ -*- C forwarding header. |
22aef514 | 2 | |
cbe34bb5 | 3 | // Copyright (C) 1997-2017 Free Software Foundation, Inc. |
22aef514 BK |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
748086b7 | 8 | // Free Software Foundation; either version 3, or (at your option) |
22aef514 BK |
9 | // any later version. |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
748086b7 JJ |
16 | // Under Section 7 of GPL version 3, you are granted additional |
17 | // permissions described in the GCC Runtime Library Exception, version | |
18 | // 3.1, as published by the Free Software Foundation. | |
22aef514 | 19 | |
748086b7 JJ |
20 | // You should have received a copy of the GNU General Public License and |
21 | // a copy of the GCC Runtime Library Exception along with this program; | |
22 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
23 | // <http://www.gnu.org/licenses/>. | |
22aef514 | 24 | |
143c27b0 | 25 | /** @file include/cmath |
ffe94f83 | 26 | * This is a Standard C++ Library file. You should @c #include this file |
2a60a9f6 | 27 | * in your programs, rather than any of the @a *.h implementation files. |
ffe94f83 PE |
28 | * |
29 | * This is the C++ version of the Standard C Library header @c math.h, | |
30 | * and its contents are (mostly) the same as that header, but are all | |
097588e4 PC |
31 | * contained in the namespace @c std (except for names which are defined |
32 | * as macros in C). | |
ffe94f83 PE |
33 | */ |
34 | ||
143c27b0 BK |
35 | // |
36 | // ISO C++ 14882: 26.5 C library | |
37 | // | |
38 | ||
1143680e SE |
39 | #ifndef _GLIBCXX_CMATH |
40 | #define _GLIBCXX_CMATH 1 | |
34ff0b99 BK |
41 | |
42 | #pragma GCC system_header | |
22aef514 | 43 | |
98e6e789 | 44 | #include <bits/c++config.h> |
cdc958d8 | 45 | #include <bits/cpp_type_traits.h> |
105c6331 | 46 | #include <ext/type_traits.h> |
4e588ec9 | 47 | |
c0dae541 | 48 | #include <math.h> |
22aef514 | 49 | |
8089616e BK |
50 | // Get rid of those macros defined in <math.h> in lieu of real functions. |
51 | #undef abs | |
52 | #undef div | |
53 | #undef acos | |
54 | #undef asin | |
55 | #undef atan | |
56 | #undef atan2 | |
57 | #undef ceil | |
58 | #undef cos | |
59 | #undef cosh | |
60 | #undef exp | |
61 | #undef fabs | |
62 | #undef floor | |
63 | #undef fmod | |
64 | #undef frexp | |
65 | #undef ldexp | |
66 | #undef log | |
67 | #undef log10 | |
68 | #undef modf | |
69 | #undef pow | |
70 | #undef sin | |
71 | #undef sinh | |
4200d6fe | 72 | #undef sqrt |
8089616e BK |
73 | #undef tan |
74 | #undef tanh | |
75 | ||
12ffa228 BK |
76 | namespace std _GLIBCXX_VISIBILITY(default) |
77 | { | |
78 | _GLIBCXX_BEGIN_NAMESPACE_VERSION | |
b39d0359 | 79 | |
4e588ec9 GDR |
80 | inline double |
81 | abs(double __x) | |
82 | { return __builtin_fabs(__x); } | |
83 | ||
d52e4867 RS |
84 | inline float |
85 | abs(float __x) | |
86 | { return __builtin_fabsf(__x); } | |
87 | ||
4e588ec9 GDR |
88 | inline long double |
89 | abs(long double __x) | |
90 | { return __builtin_fabsl(__x); } | |
91 | ||
7cf8aefc PC |
92 | template<typename _Tp> |
93 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, | |
94 | double>::__type | |
95 | abs(_Tp __x) | |
96 | { return __builtin_fabs(__x); } | |
97 | ||
de96ac46 | 98 | using ::acos; |
c85dfef7 RS |
99 | |
100 | inline float | |
101 | acos(float __x) | |
102 | { return __builtin_acosf(__x); } | |
103 | ||
104 | inline long double | |
105 | acos(long double __x) | |
106 | { return __builtin_acosl(__x); } | |
4e588ec9 | 107 | |
cdc958d8 | 108 | template<typename _Tp> |
105c6331 BK |
109 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
110 | double>::__type | |
cdc958d8 | 111 | acos(_Tp __x) |
105c6331 | 112 | { return __builtin_acos(__x); } |
7dd8177f | 113 | |
d52e4867 RS |
114 | using ::asin; |
115 | ||
7dd8177f | 116 | inline float |
c85dfef7 RS |
117 | asin(float __x) |
118 | { return __builtin_asinf(__x); } | |
22aef514 | 119 | |
7dd8177f | 120 | inline long double |
c85dfef7 RS |
121 | asin(long double __x) |
122 | { return __builtin_asinl(__x); } | |
4e588ec9 | 123 | |
cdc958d8 | 124 | template<typename _Tp> |
7cf8aefc PC |
125 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
126 | double>::__type | |
cdc958d8 | 127 | asin(_Tp __x) |
c85dfef7 | 128 | { return __builtin_asin(__x); } |
cdc958d8 | 129 | |
d52e4867 RS |
130 | using ::atan; |
131 | ||
7dd8177f | 132 | inline float |
c85dfef7 RS |
133 | atan(float __x) |
134 | { return __builtin_atanf(__x); } | |
22aef514 | 135 | |
7dd8177f | 136 | inline long double |
c85dfef7 RS |
137 | atan(long double __x) |
138 | { return __builtin_atanl(__x); } | |
4e588ec9 | 139 | |
cdc958d8 | 140 | template<typename _Tp> |
7cf8aefc PC |
141 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
142 | double>::__type | |
cdc958d8 | 143 | atan(_Tp __x) |
c85dfef7 | 144 | { return __builtin_atan(__x); } |
7dd8177f | 145 | |
d52e4867 RS |
146 | using ::atan2; |
147 | ||
7dd8177f | 148 | inline float |
98e6e789 | 149 | atan2(float __y, float __x) |
c85dfef7 | 150 | { return __builtin_atan2f(__y, __x); } |
22aef514 | 151 | |
7dd8177f | 152 | inline long double |
c85dfef7 RS |
153 | atan2(long double __y, long double __x) |
154 | { return __builtin_atan2l(__y, __x); } | |
4e588ec9 | 155 | |
cdc958d8 | 156 | template<typename _Tp, typename _Up> |
105c6331 BK |
157 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value |
158 | && __is_integer<_Up>::__value, | |
159 | double>::__type | |
c85dfef7 RS |
160 | atan2(_Tp __y, _Up __x) |
161 | { return __builtin_atan2(__y, __x); } | |
cdc958d8 | 162 | |
d52e4867 RS |
163 | using ::ceil; |
164 | ||
7dd8177f | 165 | inline float |
c85dfef7 RS |
166 | ceil(float __x) |
167 | { return __builtin_ceilf(__x); } | |
22aef514 | 168 | |
7dd8177f | 169 | inline long double |
c85dfef7 RS |
170 | ceil(long double __x) |
171 | { return __builtin_ceill(__x); } | |
22aef514 | 172 | |
cdc958d8 | 173 | template<typename _Tp> |
105c6331 BK |
174 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
175 | double>::__type | |
cdc958d8 | 176 | ceil(_Tp __x) |
c85dfef7 | 177 | { return __builtin_ceil(__x); } |
7dd8177f | 178 | |
d52e4867 RS |
179 | using ::cos; |
180 | ||
4e588ec9 GDR |
181 | inline float |
182 | cos(float __x) | |
183 | { return __builtin_cosf(__x); } | |
184 | ||
4e588ec9 GDR |
185 | inline long double |
186 | cos(long double __x) | |
187 | { return __builtin_cosl(__x); } | |
188 | ||
cdc958d8 | 189 | template<typename _Tp> |
105c6331 BK |
190 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
191 | double>::__type | |
cdc958d8 GDR |
192 | cos(_Tp __x) |
193 | { return __builtin_cos(__x); } | |
194 | ||
d52e4867 RS |
195 | using ::cosh; |
196 | ||
7dd8177f | 197 | inline float |
c85dfef7 RS |
198 | cosh(float __x) |
199 | { return __builtin_coshf(__x); } | |
22aef514 | 200 | |
7dd8177f | 201 | inline long double |
c85dfef7 RS |
202 | cosh(long double __x) |
203 | { return __builtin_coshl(__x); } | |
4e588ec9 | 204 | |
cdc958d8 | 205 | template<typename _Tp> |
105c6331 BK |
206 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
207 | double>::__type | |
cdc958d8 | 208 | cosh(_Tp __x) |
c85dfef7 | 209 | { return __builtin_cosh(__x); } |
cdc958d8 | 210 | |
d52e4867 RS |
211 | using ::exp; |
212 | ||
7dd8177f | 213 | inline float |
c85dfef7 RS |
214 | exp(float __x) |
215 | { return __builtin_expf(__x); } | |
22aef514 | 216 | |
7dd8177f | 217 | inline long double |
c85dfef7 RS |
218 | exp(long double __x) |
219 | { return __builtin_expl(__x); } | |
22aef514 | 220 | |
cdc958d8 | 221 | template<typename _Tp> |
105c6331 BK |
222 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
223 | double>::__type | |
cdc958d8 | 224 | exp(_Tp __x) |
c85dfef7 | 225 | { return __builtin_exp(__x); } |
7dd8177f | 226 | |
d52e4867 RS |
227 | using ::fabs; |
228 | ||
4e588ec9 GDR |
229 | inline float |
230 | fabs(float __x) | |
231 | { return __builtin_fabsf(__x); } | |
232 | ||
4e588ec9 GDR |
233 | inline long double |
234 | fabs(long double __x) | |
235 | { return __builtin_fabsl(__x); } | |
236 | ||
cdc958d8 | 237 | template<typename _Tp> |
105c6331 BK |
238 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
239 | double>::__type | |
cdc958d8 GDR |
240 | fabs(_Tp __x) |
241 | { return __builtin_fabs(__x); } | |
242 | ||
d52e4867 RS |
243 | using ::floor; |
244 | ||
7dd8177f | 245 | inline float |
c85dfef7 RS |
246 | floor(float __x) |
247 | { return __builtin_floorf(__x); } | |
22aef514 | 248 | |
7dd8177f | 249 | inline long double |
c85dfef7 RS |
250 | floor(long double __x) |
251 | { return __builtin_floorl(__x); } | |
4e588ec9 | 252 | |
cdc958d8 | 253 | template<typename _Tp> |
105c6331 BK |
254 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
255 | double>::__type | |
cdc958d8 | 256 | floor(_Tp __x) |
c85dfef7 | 257 | { return __builtin_floor(__x); } |
7dd8177f | 258 | |
d52e4867 RS |
259 | using ::fmod; |
260 | ||
7dd8177f | 261 | inline float |
98e6e789 | 262 | fmod(float __x, float __y) |
c85dfef7 | 263 | { return __builtin_fmodf(__x, __y); } |
22aef514 | 264 | |
7dd8177f | 265 | inline long double |
c85dfef7 RS |
266 | fmod(long double __x, long double __y) |
267 | { return __builtin_fmodl(__x, __y); } | |
4e588ec9 | 268 | |
e02d979a PC |
269 | template<typename _Tp, typename _Up> |
270 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value | |
271 | && __is_integer<_Up>::__value, | |
272 | double>::__type | |
273 | fmod(_Tp __x, _Up __y) | |
274 | { return __builtin_fmod(__x, __y); } | |
275 | ||
d52e4867 RS |
276 | using ::frexp; |
277 | ||
7dd8177f | 278 | inline float |
c85dfef7 RS |
279 | frexp(float __x, int* __exp) |
280 | { return __builtin_frexpf(__x, __exp); } | |
22aef514 | 281 | |
7dd8177f | 282 | inline long double |
c85dfef7 RS |
283 | frexp(long double __x, int* __exp) |
284 | { return __builtin_frexpl(__x, __exp); } | |
4e588ec9 | 285 | |
cdc958d8 | 286 | template<typename _Tp> |
105c6331 BK |
287 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
288 | double>::__type | |
cdc958d8 | 289 | frexp(_Tp __x, int* __exp) |
c85dfef7 | 290 | { return __builtin_frexp(__x, __exp); } |
7dd8177f | 291 | |
d52e4867 RS |
292 | using ::ldexp; |
293 | ||
7dd8177f | 294 | inline float |
98e6e789 | 295 | ldexp(float __x, int __exp) |
c85dfef7 | 296 | { return __builtin_ldexpf(__x, __exp); } |
22aef514 | 297 | |
7dd8177f | 298 | inline long double |
c85dfef7 RS |
299 | ldexp(long double __x, int __exp) |
300 | { return __builtin_ldexpl(__x, __exp); } | |
4e588ec9 | 301 | |
cdc958d8 | 302 | template<typename _Tp> |
105c6331 BK |
303 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
304 | double>::__type | |
7cf8aefc PC |
305 | ldexp(_Tp __x, int __exp) |
306 | { return __builtin_ldexp(__x, __exp); } | |
cdc958d8 | 307 | |
d52e4867 RS |
308 | using ::log; |
309 | ||
7dd8177f | 310 | inline float |
c85dfef7 RS |
311 | log(float __x) |
312 | { return __builtin_logf(__x); } | |
22aef514 | 313 | |
7dd8177f | 314 | inline long double |
c85dfef7 RS |
315 | log(long double __x) |
316 | { return __builtin_logl(__x); } | |
4e588ec9 | 317 | |
cdc958d8 | 318 | template<typename _Tp> |
105c6331 BK |
319 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
320 | double>::__type | |
cdc958d8 | 321 | log(_Tp __x) |
c85dfef7 | 322 | { return __builtin_log(__x); } |
7dd8177f | 323 | |
d52e4867 RS |
324 | using ::log10; |
325 | ||
7dd8177f | 326 | inline float |
c85dfef7 RS |
327 | log10(float __x) |
328 | { return __builtin_log10f(__x); } | |
22aef514 | 329 | |
7dd8177f | 330 | inline long double |
c85dfef7 RS |
331 | log10(long double __x) |
332 | { return __builtin_log10l(__x); } | |
4e588ec9 | 333 | |
cdc958d8 | 334 | template<typename _Tp> |
105c6331 BK |
335 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
336 | double>::__type | |
cdc958d8 | 337 | log10(_Tp __x) |
c85dfef7 | 338 | { return __builtin_log10(__x); } |
7dd8177f | 339 | |
d52e4867 RS |
340 | using ::modf; |
341 | ||
7dd8177f | 342 | inline float |
98e6e789 | 343 | modf(float __x, float* __iptr) |
c85dfef7 RS |
344 | { return __builtin_modff(__x, __iptr); } |
345 | ||
7dd8177f | 346 | inline long double |
c85dfef7 RS |
347 | modf(long double __x, long double* __iptr) |
348 | { return __builtin_modfl(__x, __iptr); } | |
4e588ec9 | 349 | |
d52e4867 RS |
350 | using ::pow; |
351 | ||
7dd8177f | 352 | inline float |
98e6e789 | 353 | pow(float __x, float __y) |
c85dfef7 | 354 | { return __builtin_powf(__x, __y); } |
22aef514 | 355 | |
7dd8177f | 356 | inline long double |
c85dfef7 RS |
357 | pow(long double __x, long double __y) |
358 | { return __builtin_powl(__x, __y); } | |
22aef514 | 359 | |
7dd8177f | 360 | inline double |
98e6e789 | 361 | pow(double __x, int __i) |
ae63a1cc | 362 | { return __builtin_powi(__x, __i); } |
22aef514 | 363 | |
7dd8177f | 364 | inline float |
d52e4867 | 365 | pow(float __x, int __n) |
ae63a1cc | 366 | { return __builtin_powif(__x, __n); } |
d52e4867 | 367 | |
7dd8177f | 368 | inline long double |
4e588ec9 | 369 | pow(long double __x, int __n) |
ae63a1cc | 370 | { return __builtin_powil(__x, __n); } |
22aef514 | 371 | |
d52e4867 RS |
372 | using ::sin; |
373 | ||
4e588ec9 GDR |
374 | inline float |
375 | sin(float __x) | |
376 | { return __builtin_sinf(__x); } | |
22aef514 | 377 | |
4e588ec9 GDR |
378 | inline long double |
379 | sin(long double __x) | |
380 | { return __builtin_sinl(__x); } | |
22aef514 | 381 | |
cdc958d8 | 382 | template<typename _Tp> |
105c6331 BK |
383 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
384 | double>::__type | |
cdc958d8 GDR |
385 | sin(_Tp __x) |
386 | { return __builtin_sin(__x); } | |
387 | ||
d52e4867 RS |
388 | using ::sinh; |
389 | ||
7dd8177f | 390 | inline float |
c85dfef7 RS |
391 | sinh(float __x) |
392 | { return __builtin_sinhf(__x); } | |
22aef514 | 393 | |
7dd8177f | 394 | inline long double |
c85dfef7 RS |
395 | sinh(long double __x) |
396 | { return __builtin_sinhl(__x); } | |
22aef514 | 397 | |
cdc958d8 | 398 | template<typename _Tp> |
105c6331 BK |
399 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
400 | double>::__type | |
cdc958d8 | 401 | sinh(_Tp __x) |
c85dfef7 | 402 | { return __builtin_sinh(__x); } |
7dd8177f | 403 | |
d52e4867 RS |
404 | using ::sqrt; |
405 | ||
4e588ec9 GDR |
406 | inline float |
407 | sqrt(float __x) | |
408 | { return __builtin_sqrtf(__x); } | |
22aef514 | 409 | |
4e588ec9 GDR |
410 | inline long double |
411 | sqrt(long double __x) | |
412 | { return __builtin_sqrtl(__x); } | |
22aef514 | 413 | |
cdc958d8 | 414 | template<typename _Tp> |
105c6331 BK |
415 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
416 | double>::__type | |
cdc958d8 GDR |
417 | sqrt(_Tp __x) |
418 | { return __builtin_sqrt(__x); } | |
7dd8177f | 419 | |
d52e4867 RS |
420 | using ::tan; |
421 | ||
7dd8177f | 422 | inline float |
c85dfef7 RS |
423 | tan(float __x) |
424 | { return __builtin_tanf(__x); } | |
22aef514 | 425 | |
7dd8177f | 426 | inline long double |
c85dfef7 RS |
427 | tan(long double __x) |
428 | { return __builtin_tanl(__x); } | |
22aef514 | 429 | |
cdc958d8 | 430 | template<typename _Tp> |
105c6331 BK |
431 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
432 | double>::__type | |
cdc958d8 | 433 | tan(_Tp __x) |
c85dfef7 | 434 | { return __builtin_tan(__x); } |
7dd8177f | 435 | |
d52e4867 RS |
436 | using ::tanh; |
437 | ||
7dd8177f | 438 | inline float |
c85dfef7 RS |
439 | tanh(float __x) |
440 | { return __builtin_tanhf(__x); } | |
22aef514 | 441 | |
7dd8177f | 442 | inline long double |
c85dfef7 RS |
443 | tanh(long double __x) |
444 | { return __builtin_tanhl(__x); } | |
cdc958d8 GDR |
445 | |
446 | template<typename _Tp> | |
105c6331 BK |
447 | inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
448 | double>::__type | |
cdc958d8 | 449 | tanh(_Tp __x) |
c85dfef7 | 450 | { return __builtin_tanh(__x); } |
3cbc7af0 | 451 | |
517da0ce | 452 | #if _GLIBCXX_USE_C99_MATH |
3d7c150e | 453 | #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC |
3cbc7af0 | 454 | |
57317d2a | 455 | // These are possible macros imported from C99-land. |
7cda84dc BK |
456 | #undef fpclassify |
457 | #undef isfinite | |
458 | #undef isinf | |
459 | #undef isnan | |
460 | #undef isnormal | |
461 | #undef signbit | |
462 | #undef isgreater | |
463 | #undef isgreaterequal | |
464 | #undef isless | |
465 | #undef islessequal | |
466 | #undef islessgreater | |
467 | #undef isunordered | |
468 | ||
7cda84dc | 469 | template<typename _Tp> |
0e7edcd5 PC |
470 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
471 | int>::__type | |
472 | fpclassify(_Tp __f) | |
473 | { | |
474 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
ebd15f80 PC |
475 | return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, |
476 | FP_SUBNORMAL, FP_ZERO, __type(__f)); | |
0e7edcd5 | 477 | } |
7cda84dc BK |
478 | |
479 | template<typename _Tp> | |
0e7edcd5 PC |
480 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
481 | int>::__type | |
482 | isfinite(_Tp __f) | |
483 | { | |
484 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
485 | return __builtin_isfinite(__type(__f)); | |
486 | } | |
7cda84dc BK |
487 | |
488 | template<typename _Tp> | |
0e7edcd5 PC |
489 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
490 | int>::__type | |
491 | isinf(_Tp __f) | |
492 | { | |
493 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
494 | return __builtin_isinf(__type(__f)); | |
495 | } | |
7cda84dc BK |
496 | |
497 | template<typename _Tp> | |
0e7edcd5 PC |
498 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
499 | int>::__type | |
500 | isnan(_Tp __f) | |
501 | { | |
502 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
503 | return __builtin_isnan(__type(__f)); | |
504 | } | |
7cda84dc BK |
505 | |
506 | template<typename _Tp> | |
0e7edcd5 PC |
507 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
508 | int>::__type | |
509 | isnormal(_Tp __f) | |
510 | { | |
511 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
512 | return __builtin_isnormal(__type(__f)); | |
513 | } | |
7cda84dc BK |
514 | |
515 | template<typename _Tp> | |
0e7edcd5 PC |
516 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
517 | int>::__type | |
518 | signbit(_Tp __f) | |
519 | { | |
520 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
521 | return __builtin_signbit(__type(__f)); | |
522 | } | |
7cda84dc BK |
523 | |
524 | template<typename _Tp> | |
0e7edcd5 PC |
525 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
526 | int>::__type | |
3a2794ab | 527 | isgreater(_Tp __f1, _Tp __f2) |
0e7edcd5 PC |
528 | { |
529 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
530 | return __builtin_isgreater(__type(__f1), __type(__f2)); | |
531 | } | |
7cda84dc BK |
532 | |
533 | template<typename _Tp> | |
0e7edcd5 PC |
534 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
535 | int>::__type | |
7dd8177f | 536 | isgreaterequal(_Tp __f1, _Tp __f2) |
0e7edcd5 PC |
537 | { |
538 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
539 | return __builtin_isgreaterequal(__type(__f1), __type(__f2)); | |
540 | } | |
7cda84dc BK |
541 | |
542 | template<typename _Tp> | |
0e7edcd5 PC |
543 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
544 | int>::__type | |
3a2794ab | 545 | isless(_Tp __f1, _Tp __f2) |
0e7edcd5 PC |
546 | { |
547 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
548 | return __builtin_isless(__type(__f1), __type(__f2)); | |
549 | } | |
7cda84dc BK |
550 | |
551 | template<typename _Tp> | |
0e7edcd5 PC |
552 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
553 | int>::__type | |
7dd8177f | 554 | islessequal(_Tp __f1, _Tp __f2) |
0e7edcd5 PC |
555 | { |
556 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
557 | return __builtin_islessequal(__type(__f1), __type(__f2)); | |
558 | } | |
7cda84dc BK |
559 | |
560 | template<typename _Tp> | |
0e7edcd5 PC |
561 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
562 | int>::__type | |
7dd8177f | 563 | islessgreater(_Tp __f1, _Tp __f2) |
0e7edcd5 PC |
564 | { |
565 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
566 | return __builtin_islessgreater(__type(__f1), __type(__f2)); | |
567 | } | |
7cda84dc BK |
568 | |
569 | template<typename _Tp> | |
0e7edcd5 PC |
570 | inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
571 | int>::__type | |
7dd8177f | 572 | isunordered(_Tp __f1, _Tp __f2) |
0e7edcd5 PC |
573 | { |
574 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; | |
575 | return __builtin_isunordered(__type(__f1), __type(__f2)); | |
576 | } | |
3cbc7af0 | 577 | |
4a15d842 FD |
578 | #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ |
579 | #endif /* _GLIBCXX_USE_C99_MATH */ | |
580 | ||
12ffa228 BK |
581 | _GLIBCXX_END_NAMESPACE_VERSION |
582 | } // namespace std | |
3cbc7af0 | 583 | |
98e6e789 | 584 | #endif |