libstdc++
|
00001 // -*- C++ -*- C forwarding header. 00002 00003 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 00004 // 2006, 2007, 2008, 2009, 2010 00005 // Free Software Foundation, Inc. 00006 // 00007 // This file is part of the GNU ISO C++ Library. This library is free 00008 // software; you can redistribute it and/or modify it under the 00009 // terms of the GNU General Public License as published by the 00010 // Free Software Foundation; either version 3, or (at your option) 00011 // any later version. 00012 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 00018 // Under Section 7 of GPL version 3, you are granted additional 00019 // permissions described in the GCC Runtime Library Exception, version 00020 // 3.1, as published by the Free Software Foundation. 00021 00022 // You should have received a copy of the GNU General Public License and 00023 // a copy of the GCC Runtime Library Exception along with this program; 00024 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00025 // <http://www.gnu.org/licenses/>. 00026 00027 /** @file include/cmath 00028 * This is a Standard C++ Library file. You should @c \#include this file 00029 * in your programs, rather than any of the @a *.h implementation files. 00030 * 00031 * This is the C++ version of the Standard C Library header @c math.h, 00032 * and its contents are (mostly) the same as that header, but are all 00033 * contained in the namespace @c std (except for names which are defined 00034 * as macros in C). 00035 */ 00036 00037 // 00038 // ISO C++ 14882: 26.5 C library 00039 // 00040 00041 #pragma GCC system_header 00042 00043 #include <bits/c++config.h> 00044 #include <bits/cpp_type_traits.h> 00045 #include <ext/type_traits.h> 00046 #include <math.h> 00047 00048 #ifndef _GLIBCXX_CMATH 00049 #define _GLIBCXX_CMATH 1 00050 00051 // Get rid of those macros defined in <math.h> in lieu of real functions. 00052 #undef abs 00053 #undef div 00054 #undef acos 00055 #undef asin 00056 #undef atan 00057 #undef atan2 00058 #undef ceil 00059 #undef cos 00060 #undef cosh 00061 #undef exp 00062 #undef fabs 00063 #undef floor 00064 #undef fmod 00065 #undef frexp 00066 #undef ldexp 00067 #undef log 00068 #undef log10 00069 #undef modf 00070 #undef pow 00071 #undef sin 00072 #undef sinh 00073 #undef sqrt 00074 #undef tan 00075 #undef tanh 00076 00077 namespace std _GLIBCXX_VISIBILITY(default) 00078 { 00079 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00080 00081 inline double 00082 abs(double __x) 00083 { return __builtin_fabs(__x); } 00084 00085 inline float 00086 abs(float __x) 00087 { return __builtin_fabsf(__x); } 00088 00089 inline long double 00090 abs(long double __x) 00091 { return __builtin_fabsl(__x); } 00092 00093 template<typename _Tp> 00094 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00095 double>::__type 00096 abs(_Tp __x) 00097 { return __builtin_fabs(__x); } 00098 00099 using ::acos; 00100 00101 inline float 00102 acos(float __x) 00103 { return __builtin_acosf(__x); } 00104 00105 inline long double 00106 acos(long double __x) 00107 { return __builtin_acosl(__x); } 00108 00109 template<typename _Tp> 00110 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00111 double>::__type 00112 acos(_Tp __x) 00113 { return __builtin_acos(__x); } 00114 00115 using ::asin; 00116 00117 inline float 00118 asin(float __x) 00119 { return __builtin_asinf(__x); } 00120 00121 inline long double 00122 asin(long double __x) 00123 { return __builtin_asinl(__x); } 00124 00125 template<typename _Tp> 00126 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00127 double>::__type 00128 asin(_Tp __x) 00129 { return __builtin_asin(__x); } 00130 00131 using ::atan; 00132 00133 inline float 00134 atan(float __x) 00135 { return __builtin_atanf(__x); } 00136 00137 inline long double 00138 atan(long double __x) 00139 { return __builtin_atanl(__x); } 00140 00141 template<typename _Tp> 00142 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00143 double>::__type 00144 atan(_Tp __x) 00145 { return __builtin_atan(__x); } 00146 00147 using ::atan2; 00148 00149 inline float 00150 atan2(float __y, float __x) 00151 { return __builtin_atan2f(__y, __x); } 00152 00153 inline long double 00154 atan2(long double __y, long double __x) 00155 { return __builtin_atan2l(__y, __x); } 00156 00157 template<typename _Tp, typename _Up> 00158 inline 00159 typename __gnu_cxx::__promote_2< 00160 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 00161 && __is_arithmetic<_Up>::__value, 00162 _Tp>::__type, _Up>::__type 00163 atan2(_Tp __y, _Up __x) 00164 { 00165 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00166 return atan2(__type(__y), __type(__x)); 00167 } 00168 00169 using ::ceil; 00170 00171 inline float 00172 ceil(float __x) 00173 { return __builtin_ceilf(__x); } 00174 00175 inline long double 00176 ceil(long double __x) 00177 { return __builtin_ceill(__x); } 00178 00179 template<typename _Tp> 00180 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00181 double>::__type 00182 ceil(_Tp __x) 00183 { return __builtin_ceil(__x); } 00184 00185 using ::cos; 00186 00187 inline float 00188 cos(float __x) 00189 { return __builtin_cosf(__x); } 00190 00191 inline long double 00192 cos(long double __x) 00193 { return __builtin_cosl(__x); } 00194 00195 template<typename _Tp> 00196 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00197 double>::__type 00198 cos(_Tp __x) 00199 { return __builtin_cos(__x); } 00200 00201 using ::cosh; 00202 00203 inline float 00204 cosh(float __x) 00205 { return __builtin_coshf(__x); } 00206 00207 inline long double 00208 cosh(long double __x) 00209 { return __builtin_coshl(__x); } 00210 00211 template<typename _Tp> 00212 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00213 double>::__type 00214 cosh(_Tp __x) 00215 { return __builtin_cosh(__x); } 00216 00217 using ::exp; 00218 00219 inline float 00220 exp(float __x) 00221 { return __builtin_expf(__x); } 00222 00223 inline long double 00224 exp(long double __x) 00225 { return __builtin_expl(__x); } 00226 00227 template<typename _Tp> 00228 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00229 double>::__type 00230 exp(_Tp __x) 00231 { return __builtin_exp(__x); } 00232 00233 using ::fabs; 00234 00235 inline float 00236 fabs(float __x) 00237 { return __builtin_fabsf(__x); } 00238 00239 inline long double 00240 fabs(long double __x) 00241 { return __builtin_fabsl(__x); } 00242 00243 template<typename _Tp> 00244 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00245 double>::__type 00246 fabs(_Tp __x) 00247 { return __builtin_fabs(__x); } 00248 00249 using ::floor; 00250 00251 inline float 00252 floor(float __x) 00253 { return __builtin_floorf(__x); } 00254 00255 inline long double 00256 floor(long double __x) 00257 { return __builtin_floorl(__x); } 00258 00259 template<typename _Tp> 00260 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00261 double>::__type 00262 floor(_Tp __x) 00263 { return __builtin_floor(__x); } 00264 00265 using ::fmod; 00266 00267 inline float 00268 fmod(float __x, float __y) 00269 { return __builtin_fmodf(__x, __y); } 00270 00271 inline long double 00272 fmod(long double __x, long double __y) 00273 { return __builtin_fmodl(__x, __y); } 00274 00275 using ::frexp; 00276 00277 inline float 00278 frexp(float __x, int* __exp) 00279 { return __builtin_frexpf(__x, __exp); } 00280 00281 inline long double 00282 frexp(long double __x, int* __exp) 00283 { return __builtin_frexpl(__x, __exp); } 00284 00285 template<typename _Tp> 00286 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00287 double>::__type 00288 frexp(_Tp __x, int* __exp) 00289 { return __builtin_frexp(__x, __exp); } 00290 00291 using ::ldexp; 00292 00293 inline float 00294 ldexp(float __x, int __exp) 00295 { return __builtin_ldexpf(__x, __exp); } 00296 00297 inline long double 00298 ldexp(long double __x, int __exp) 00299 { return __builtin_ldexpl(__x, __exp); } 00300 00301 template<typename _Tp> 00302 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00303 double>::__type 00304 ldexp(_Tp __x, int __exp) 00305 { return __builtin_ldexp(__x, __exp); } 00306 00307 using ::log; 00308 00309 inline float 00310 log(float __x) 00311 { return __builtin_logf(__x); } 00312 00313 inline long double 00314 log(long double __x) 00315 { return __builtin_logl(__x); } 00316 00317 template<typename _Tp> 00318 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00319 double>::__type 00320 log(_Tp __x) 00321 { return __builtin_log(__x); } 00322 00323 using ::log10; 00324 00325 inline float 00326 log10(float __x) 00327 { return __builtin_log10f(__x); } 00328 00329 inline long double 00330 log10(long double __x) 00331 { return __builtin_log10l(__x); } 00332 00333 template<typename _Tp> 00334 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00335 double>::__type 00336 log10(_Tp __x) 00337 { return __builtin_log10(__x); } 00338 00339 using ::modf; 00340 00341 inline float 00342 modf(float __x, float* __iptr) 00343 { return __builtin_modff(__x, __iptr); } 00344 00345 inline long double 00346 modf(long double __x, long double* __iptr) 00347 { return __builtin_modfl(__x, __iptr); } 00348 00349 using ::pow; 00350 00351 inline float 00352 pow(float __x, float __y) 00353 { return __builtin_powf(__x, __y); } 00354 00355 inline long double 00356 pow(long double __x, long double __y) 00357 { return __builtin_powl(__x, __y); } 00358 00359 #ifndef __GXX_EXPERIMENTAL_CXX0X__ 00360 // _GLIBCXX_RESOLVE_LIB_DEFECTS 00361 // DR 550. What should the return type of pow(float,int) be? 00362 inline double 00363 pow(double __x, int __i) 00364 { return __builtin_powi(__x, __i); } 00365 00366 inline float 00367 pow(float __x, int __n) 00368 { return __builtin_powif(__x, __n); } 00369 00370 inline long double 00371 pow(long double __x, int __n) 00372 { return __builtin_powil(__x, __n); } 00373 #endif 00374 00375 template<typename _Tp, typename _Up> 00376 inline 00377 typename __gnu_cxx::__promote_2< 00378 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 00379 && __is_arithmetic<_Up>::__value, 00380 _Tp>::__type, _Up>::__type 00381 pow(_Tp __x, _Up __y) 00382 { 00383 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00384 return pow(__type(__x), __type(__y)); 00385 } 00386 00387 using ::sin; 00388 00389 inline float 00390 sin(float __x) 00391 { return __builtin_sinf(__x); } 00392 00393 inline long double 00394 sin(long double __x) 00395 { return __builtin_sinl(__x); } 00396 00397 template<typename _Tp> 00398 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00399 double>::__type 00400 sin(_Tp __x) 00401 { return __builtin_sin(__x); } 00402 00403 using ::sinh; 00404 00405 inline float 00406 sinh(float __x) 00407 { return __builtin_sinhf(__x); } 00408 00409 inline long double 00410 sinh(long double __x) 00411 { return __builtin_sinhl(__x); } 00412 00413 template<typename _Tp> 00414 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00415 double>::__type 00416 sinh(_Tp __x) 00417 { return __builtin_sinh(__x); } 00418 00419 using ::sqrt; 00420 00421 inline float 00422 sqrt(float __x) 00423 { return __builtin_sqrtf(__x); } 00424 00425 inline long double 00426 sqrt(long double __x) 00427 { return __builtin_sqrtl(__x); } 00428 00429 template<typename _Tp> 00430 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00431 double>::__type 00432 sqrt(_Tp __x) 00433 { return __builtin_sqrt(__x); } 00434 00435 using ::tan; 00436 00437 inline float 00438 tan(float __x) 00439 { return __builtin_tanf(__x); } 00440 00441 inline long double 00442 tan(long double __x) 00443 { return __builtin_tanl(__x); } 00444 00445 template<typename _Tp> 00446 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00447 double>::__type 00448 tan(_Tp __x) 00449 { return __builtin_tan(__x); } 00450 00451 using ::tanh; 00452 00453 inline float 00454 tanh(float __x) 00455 { return __builtin_tanhf(__x); } 00456 00457 inline long double 00458 tanh(long double __x) 00459 { return __builtin_tanhl(__x); } 00460 00461 template<typename _Tp> 00462 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00463 double>::__type 00464 tanh(_Tp __x) 00465 { return __builtin_tanh(__x); } 00466 00467 _GLIBCXX_END_NAMESPACE_VERSION 00468 } // namespace 00469 00470 #if _GLIBCXX_USE_C99_MATH 00471 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 00472 00473 // These are possible macros imported from C99-land. 00474 #undef fpclassify 00475 #undef isfinite 00476 #undef isinf 00477 #undef isnan 00478 #undef isnormal 00479 #undef signbit 00480 #undef isgreater 00481 #undef isgreaterequal 00482 #undef isless 00483 #undef islessequal 00484 #undef islessgreater 00485 #undef isunordered 00486 00487 namespace std _GLIBCXX_VISIBILITY(default) 00488 { 00489 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00490 00491 #ifdef __GXX_EXPERIMENTAL_CXX0X__ 00492 inline int 00493 fpclassify(float __x) 00494 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 00495 FP_SUBNORMAL, FP_ZERO, __x); } 00496 00497 inline int 00498 fpclassify(double __x) 00499 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 00500 FP_SUBNORMAL, FP_ZERO, __x); } 00501 00502 inline int 00503 fpclassify(long double __x) 00504 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 00505 FP_SUBNORMAL, FP_ZERO, __x); } 00506 00507 template<typename _Tp> 00508 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00509 int>::__type 00510 fpclassify(_Tp __x) 00511 { return __x != 0 ? FP_NORMAL : FP_ZERO; } 00512 00513 inline bool 00514 isfinite(float __x) 00515 { return __builtin_isfinite(__x); } 00516 00517 inline bool 00518 isfinite(double __x) 00519 { return __builtin_isfinite(__x); } 00520 00521 inline bool 00522 isfinite(long double __x) 00523 { return __builtin_isfinite(__x); } 00524 00525 template<typename _Tp> 00526 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00527 bool>::__type 00528 isfinite(_Tp __x) 00529 { return true; } 00530 00531 inline bool 00532 isinf(float __x) 00533 { return __builtin_isinf(__x); } 00534 00535 inline bool 00536 isinf(double __x) 00537 { return __builtin_isinf(__x); } 00538 00539 inline bool 00540 isinf(long double __x) 00541 { return __builtin_isinf(__x); } 00542 00543 template<typename _Tp> 00544 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00545 bool>::__type 00546 isinf(_Tp __x) 00547 { return false; } 00548 00549 inline bool 00550 isnan(float __x) 00551 { return __builtin_isnan(__x); } 00552 00553 inline bool 00554 isnan(double __x) 00555 { return __builtin_isnan(__x); } 00556 00557 inline bool 00558 isnan(long double __x) 00559 { return __builtin_isnan(__x); } 00560 00561 template<typename _Tp> 00562 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00563 bool>::__type 00564 isnan(_Tp __x) 00565 { return false; } 00566 00567 inline bool 00568 isnormal(float __x) 00569 { return __builtin_isnormal(__x); } 00570 00571 inline bool 00572 isnormal(double __x) 00573 { return __builtin_isnormal(__x); } 00574 00575 inline bool 00576 isnormal(long double __x) 00577 { return __builtin_isnormal(__x); } 00578 00579 template<typename _Tp> 00580 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00581 bool>::__type 00582 isnormal(_Tp __x) 00583 { return __x != 0 ? true : false; } 00584 00585 inline bool 00586 signbit(float __x) 00587 { return __builtin_signbit(__x); } 00588 00589 inline bool 00590 signbit(double __x) 00591 { return __builtin_signbit(__x); } 00592 00593 inline bool 00594 signbit(long double __x) 00595 { return __builtin_signbit(__x); } 00596 00597 template<typename _Tp> 00598 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00599 bool>::__type 00600 signbit(_Tp __x) 00601 { return __x < 0 ? true : false; } 00602 00603 inline bool 00604 isgreater(float __x, float __y) 00605 { return __builtin_isgreater(__x, __y); } 00606 00607 inline bool 00608 isgreater(double __x, double __y) 00609 { return __builtin_isgreater(__x, __y); } 00610 00611 inline bool 00612 isgreater(long double __x, long double __y) 00613 { return __builtin_isgreater(__x, __y); } 00614 00615 template<typename _Tp, typename _Up> 00616 inline typename 00617 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 00618 && __is_arithmetic<_Up>::__value), bool>::__type 00619 isgreater(_Tp __x, _Up __y) 00620 { 00621 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00622 return __builtin_isgreater(__type(__x), __type(__y)); 00623 } 00624 00625 inline bool 00626 isgreaterequal(float __x, float __y) 00627 { return __builtin_isgreaterequal(__x, __y); } 00628 00629 inline bool 00630 isgreaterequal(double __x, double __y) 00631 { return __builtin_isgreaterequal(__x, __y); } 00632 00633 inline bool 00634 isgreaterequal(long double __x, long double __y) 00635 { return __builtin_isgreaterequal(__x, __y); } 00636 00637 template<typename _Tp, typename _Up> 00638 inline typename 00639 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 00640 && __is_arithmetic<_Up>::__value), bool>::__type 00641 isgreaterequal(_Tp __x, _Up __y) 00642 { 00643 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00644 return __builtin_isgreaterequal(__type(__x), __type(__y)); 00645 } 00646 00647 inline bool 00648 isless(float __x, float __y) 00649 { return __builtin_isless(__x, __y); } 00650 00651 inline bool 00652 isless(double __x, double __y) 00653 { return __builtin_isless(__x, __y); } 00654 00655 inline bool 00656 isless(long double __x, long double __y) 00657 { return __builtin_isless(__x, __y); } 00658 00659 template<typename _Tp, typename _Up> 00660 inline typename 00661 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 00662 && __is_arithmetic<_Up>::__value), bool>::__type 00663 isless(_Tp __x, _Up __y) 00664 { 00665 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00666 return __builtin_isless(__type(__x), __type(__y)); 00667 } 00668 00669 inline bool 00670 islessequal(float __x, float __y) 00671 { return __builtin_islessequal(__x, __y); } 00672 00673 inline bool 00674 islessequal(double __x, double __y) 00675 { return __builtin_islessequal(__x, __y); } 00676 00677 inline bool 00678 islessequal(long double __x, long double __y) 00679 { return __builtin_islessequal(__x, __y); } 00680 00681 template<typename _Tp, typename _Up> 00682 inline typename 00683 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 00684 && __is_arithmetic<_Up>::__value), bool>::__type 00685 islessequal(_Tp __x, _Up __y) 00686 { 00687 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00688 return __builtin_islessequal(__type(__x), __type(__y)); 00689 } 00690 00691 inline bool 00692 islessgreater(float __x, float __y) 00693 { return __builtin_islessgreater(__x, __y); } 00694 00695 inline bool 00696 islessgreater(double __x, double __y) 00697 { return __builtin_islessgreater(__x, __y); } 00698 00699 inline bool 00700 islessgreater(long double __x, long double __y) 00701 { return __builtin_islessgreater(__x, __y); } 00702 00703 template<typename _Tp, typename _Up> 00704 inline typename 00705 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 00706 && __is_arithmetic<_Up>::__value), bool>::__type 00707 islessgreater(_Tp __x, _Up __y) 00708 { 00709 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00710 return __builtin_islessgreater(__type(__x), __type(__y)); 00711 } 00712 00713 inline bool 00714 isunordered(float __x, float __y) 00715 { return __builtin_isunordered(__x, __y); } 00716 00717 inline bool 00718 isunordered(double __x, double __y) 00719 { return __builtin_isunordered(__x, __y); } 00720 00721 inline bool 00722 isunordered(long double __x, long double __y) 00723 { return __builtin_isunordered(__x, __y); } 00724 00725 template<typename _Tp, typename _Up> 00726 inline typename 00727 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 00728 && __is_arithmetic<_Up>::__value), bool>::__type 00729 isunordered(_Tp __x, _Up __y) 00730 { 00731 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00732 return __builtin_isunordered(__type(__x), __type(__y)); 00733 } 00734 00735 #else 00736 00737 template<typename _Tp> 00738 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00739 int>::__type 00740 fpclassify(_Tp __f) 00741 { 00742 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00743 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 00744 FP_SUBNORMAL, FP_ZERO, __type(__f)); 00745 } 00746 00747 template<typename _Tp> 00748 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00749 int>::__type 00750 isfinite(_Tp __f) 00751 { 00752 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00753 return __builtin_isfinite(__type(__f)); 00754 } 00755 00756 template<typename _Tp> 00757 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00758 int>::__type 00759 isinf(_Tp __f) 00760 { 00761 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00762 return __builtin_isinf(__type(__f)); 00763 } 00764 00765 template<typename _Tp> 00766 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00767 int>::__type 00768 isnan(_Tp __f) 00769 { 00770 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00771 return __builtin_isnan(__type(__f)); 00772 } 00773 00774 template<typename _Tp> 00775 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00776 int>::__type 00777 isnormal(_Tp __f) 00778 { 00779 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00780 return __builtin_isnormal(__type(__f)); 00781 } 00782 00783 template<typename _Tp> 00784 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00785 int>::__type 00786 signbit(_Tp __f) 00787 { 00788 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00789 return __builtin_signbit(__type(__f)); 00790 } 00791 00792 template<typename _Tp> 00793 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00794 int>::__type 00795 isgreater(_Tp __f1, _Tp __f2) 00796 { 00797 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00798 return __builtin_isgreater(__type(__f1), __type(__f2)); 00799 } 00800 00801 template<typename _Tp> 00802 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00803 int>::__type 00804 isgreaterequal(_Tp __f1, _Tp __f2) 00805 { 00806 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00807 return __builtin_isgreaterequal(__type(__f1), __type(__f2)); 00808 } 00809 00810 template<typename _Tp> 00811 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00812 int>::__type 00813 isless(_Tp __f1, _Tp __f2) 00814 { 00815 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00816 return __builtin_isless(__type(__f1), __type(__f2)); 00817 } 00818 00819 template<typename _Tp> 00820 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00821 int>::__type 00822 islessequal(_Tp __f1, _Tp __f2) 00823 { 00824 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00825 return __builtin_islessequal(__type(__f1), __type(__f2)); 00826 } 00827 00828 template<typename _Tp> 00829 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00830 int>::__type 00831 islessgreater(_Tp __f1, _Tp __f2) 00832 { 00833 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00834 return __builtin_islessgreater(__type(__f1), __type(__f2)); 00835 } 00836 00837 template<typename _Tp> 00838 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 00839 int>::__type 00840 isunordered(_Tp __f1, _Tp __f2) 00841 { 00842 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 00843 return __builtin_isunordered(__type(__f1), __type(__f2)); 00844 } 00845 00846 #endif 00847 00848 _GLIBCXX_END_NAMESPACE_VERSION 00849 } // namespace 00850 00851 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ 00852 #endif 00853 00854 #ifdef __GXX_EXPERIMENTAL_CXX0X__ 00855 00856 #ifdef _GLIBCXX_USE_C99_MATH_TR1 00857 00858 #undef acosh 00859 #undef acoshf 00860 #undef acoshl 00861 #undef asinh 00862 #undef asinhf 00863 #undef asinhl 00864 #undef atanh 00865 #undef atanhf 00866 #undef atanhl 00867 #undef cbrt 00868 #undef cbrtf 00869 #undef cbrtl 00870 #undef copysign 00871 #undef copysignf 00872 #undef copysignl 00873 #undef erf 00874 #undef erff 00875 #undef erfl 00876 #undef erfc 00877 #undef erfcf 00878 #undef erfcl 00879 #undef exp2 00880 #undef exp2f 00881 #undef exp2l 00882 #undef expm1 00883 #undef expm1f 00884 #undef expm1l 00885 #undef fdim 00886 #undef fdimf 00887 #undef fdiml 00888 #undef fma 00889 #undef fmaf 00890 #undef fmal 00891 #undef fmax 00892 #undef fmaxf 00893 #undef fmaxl 00894 #undef fmin 00895 #undef fminf 00896 #undef fminl 00897 #undef hypot 00898 #undef hypotf 00899 #undef hypotl 00900 #undef ilogb 00901 #undef ilogbf 00902 #undef ilogbl 00903 #undef lgamma 00904 #undef lgammaf 00905 #undef lgammal 00906 #undef llrint 00907 #undef llrintf 00908 #undef llrintl 00909 #undef llround 00910 #undef llroundf 00911 #undef llroundl 00912 #undef log1p 00913 #undef log1pf 00914 #undef log1pl 00915 #undef log2 00916 #undef log2f 00917 #undef log2l 00918 #undef logb 00919 #undef logbf 00920 #undef logbl 00921 #undef lrint 00922 #undef lrintf 00923 #undef lrintl 00924 #undef lround 00925 #undef lroundf 00926 #undef lroundl 00927 #undef nan 00928 #undef nanf 00929 #undef nanl 00930 #undef nearbyint 00931 #undef nearbyintf 00932 #undef nearbyintl 00933 #undef nextafter 00934 #undef nextafterf 00935 #undef nextafterl 00936 #undef nexttoward 00937 #undef nexttowardf 00938 #undef nexttowardl 00939 #undef remainder 00940 #undef remainderf 00941 #undef remainderl 00942 #undef remquo 00943 #undef remquof 00944 #undef remquol 00945 #undef rint 00946 #undef rintf 00947 #undef rintl 00948 #undef round 00949 #undef roundf 00950 #undef roundl 00951 #undef scalbln 00952 #undef scalblnf 00953 #undef scalblnl 00954 #undef scalbn 00955 #undef scalbnf 00956 #undef scalbnl 00957 #undef tgamma 00958 #undef tgammaf 00959 #undef tgammal 00960 #undef trunc 00961 #undef truncf 00962 #undef truncl 00963 00964 namespace std _GLIBCXX_VISIBILITY(default) 00965 { 00966 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00967 00968 // types 00969 using ::double_t; 00970 using ::float_t; 00971 00972 // functions 00973 using ::acosh; 00974 using ::acoshf; 00975 using ::acoshl; 00976 00977 using ::asinh; 00978 using ::asinhf; 00979 using ::asinhl; 00980 00981 using ::atanh; 00982 using ::atanhf; 00983 using ::atanhl; 00984 00985 using ::cbrt; 00986 using ::cbrtf; 00987 using ::cbrtl; 00988 00989 using ::copysign; 00990 using ::copysignf; 00991 using ::copysignl; 00992 00993 using ::erf; 00994 using ::erff; 00995 using ::erfl; 00996 00997 using ::erfc; 00998 using ::erfcf; 00999 using ::erfcl; 01000 01001 using ::exp2; 01002 using ::exp2f; 01003 using ::exp2l; 01004 01005 using ::expm1; 01006 using ::expm1f; 01007 using ::expm1l; 01008 01009 using ::fdim; 01010 using ::fdimf; 01011 using ::fdiml; 01012 01013 using ::fma; 01014 using ::fmaf; 01015 using ::fmal; 01016 01017 using ::fmax; 01018 using ::fmaxf; 01019 using ::fmaxl; 01020 01021 using ::fmin; 01022 using ::fminf; 01023 using ::fminl; 01024 01025 using ::hypot; 01026 using ::hypotf; 01027 using ::hypotl; 01028 01029 using ::ilogb; 01030 using ::ilogbf; 01031 using ::ilogbl; 01032 01033 using ::lgamma; 01034 using ::lgammaf; 01035 using ::lgammal; 01036 01037 using ::llrint; 01038 using ::llrintf; 01039 using ::llrintl; 01040 01041 using ::llround; 01042 using ::llroundf; 01043 using ::llroundl; 01044 01045 using ::log1p; 01046 using ::log1pf; 01047 using ::log1pl; 01048 01049 using ::log2; 01050 using ::log2f; 01051 using ::log2l; 01052 01053 using ::logb; 01054 using ::logbf; 01055 using ::logbl; 01056 01057 using ::lrint; 01058 using ::lrintf; 01059 using ::lrintl; 01060 01061 using ::lround; 01062 using ::lroundf; 01063 using ::lroundl; 01064 01065 using ::nan; 01066 using ::nanf; 01067 using ::nanl; 01068 01069 using ::nearbyint; 01070 using ::nearbyintf; 01071 using ::nearbyintl; 01072 01073 using ::nextafter; 01074 using ::nextafterf; 01075 using ::nextafterl; 01076 01077 using ::nexttoward; 01078 using ::nexttowardf; 01079 using ::nexttowardl; 01080 01081 using ::remainder; 01082 using ::remainderf; 01083 using ::remainderl; 01084 01085 using ::remquo; 01086 using ::remquof; 01087 using ::remquol; 01088 01089 using ::rint; 01090 using ::rintf; 01091 using ::rintl; 01092 01093 using ::round; 01094 using ::roundf; 01095 using ::roundl; 01096 01097 using ::scalbln; 01098 using ::scalblnf; 01099 using ::scalblnl; 01100 01101 using ::scalbn; 01102 using ::scalbnf; 01103 using ::scalbnl; 01104 01105 using ::tgamma; 01106 using ::tgammaf; 01107 using ::tgammal; 01108 01109 using ::trunc; 01110 using ::truncf; 01111 using ::truncl; 01112 01113 /// Additional overloads. 01114 inline float 01115 acosh(float __x) 01116 { return __builtin_acoshf(__x); } 01117 01118 inline long double 01119 acosh(long double __x) 01120 { return __builtin_acoshl(__x); } 01121 01122 template<typename _Tp> 01123 inline typename __gnu_cxx::__promote<_Tp>::__type 01124 acosh(_Tp __x) 01125 { 01126 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01127 return acosh(__type(__x)); 01128 } 01129 01130 inline float 01131 asinh(float __x) 01132 { return __builtin_asinhf(__x); } 01133 01134 inline long double 01135 asinh(long double __x) 01136 { return __builtin_asinhl(__x); } 01137 01138 template<typename _Tp> 01139 inline typename __gnu_cxx::__promote<_Tp>::__type 01140 asinh(_Tp __x) 01141 { 01142 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01143 return asinh(__type(__x)); 01144 } 01145 01146 inline float 01147 atanh(float __x) 01148 { return __builtin_atanhf(__x); } 01149 01150 inline long double 01151 atanh(long double __x) 01152 { return __builtin_atanhl(__x); } 01153 01154 template<typename _Tp> 01155 inline typename __gnu_cxx::__promote<_Tp>::__type 01156 atanh(_Tp __x) 01157 { 01158 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01159 return atanh(__type(__x)); 01160 } 01161 01162 inline float 01163 cbrt(float __x) 01164 { return __builtin_cbrtf(__x); } 01165 01166 inline long double 01167 cbrt(long double __x) 01168 { return __builtin_cbrtl(__x); } 01169 01170 template<typename _Tp> 01171 inline typename __gnu_cxx::__promote<_Tp>::__type 01172 cbrt(_Tp __x) 01173 { 01174 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01175 return cbrt(__type(__x)); 01176 } 01177 01178 inline float 01179 copysign(float __x, float __y) 01180 { return __builtin_copysignf(__x, __y); } 01181 01182 inline long double 01183 copysign(long double __x, long double __y) 01184 { return __builtin_copysignl(__x, __y); } 01185 01186 template<typename _Tp, typename _Up> 01187 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01188 copysign(_Tp __x, _Up __y) 01189 { 01190 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01191 return copysign(__type(__x), __type(__y)); 01192 } 01193 01194 inline float 01195 erf(float __x) 01196 { return __builtin_erff(__x); } 01197 01198 inline long double 01199 erf(long double __x) 01200 { return __builtin_erfl(__x); } 01201 01202 template<typename _Tp> 01203 inline typename __gnu_cxx::__promote<_Tp>::__type 01204 erf(_Tp __x) 01205 { 01206 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01207 return erf(__type(__x)); 01208 } 01209 01210 inline float 01211 erfc(float __x) 01212 { return __builtin_erfcf(__x); } 01213 01214 inline long double 01215 erfc(long double __x) 01216 { return __builtin_erfcl(__x); } 01217 01218 template<typename _Tp> 01219 inline typename __gnu_cxx::__promote<_Tp>::__type 01220 erfc(_Tp __x) 01221 { 01222 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01223 return erfc(__type(__x)); 01224 } 01225 01226 inline float 01227 exp2(float __x) 01228 { return __builtin_exp2f(__x); } 01229 01230 inline long double 01231 exp2(long double __x) 01232 { return __builtin_exp2l(__x); } 01233 01234 template<typename _Tp> 01235 inline typename __gnu_cxx::__promote<_Tp>::__type 01236 exp2(_Tp __x) 01237 { 01238 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01239 return exp2(__type(__x)); 01240 } 01241 01242 inline float 01243 expm1(float __x) 01244 { return __builtin_expm1f(__x); } 01245 01246 inline long double 01247 expm1(long double __x) 01248 { return __builtin_expm1l(__x); } 01249 01250 template<typename _Tp> 01251 inline typename __gnu_cxx::__promote<_Tp>::__type 01252 expm1(_Tp __x) 01253 { 01254 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01255 return expm1(__type(__x)); 01256 } 01257 01258 inline float 01259 fdim(float __x, float __y) 01260 { return __builtin_fdimf(__x, __y); } 01261 01262 inline long double 01263 fdim(long double __x, long double __y) 01264 { return __builtin_fdiml(__x, __y); } 01265 01266 template<typename _Tp, typename _Up> 01267 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01268 fdim(_Tp __x, _Up __y) 01269 { 01270 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01271 return fdim(__type(__x), __type(__y)); 01272 } 01273 01274 inline float 01275 fma(float __x, float __y, float __z) 01276 { return __builtin_fmaf(__x, __y, __z); } 01277 01278 inline long double 01279 fma(long double __x, long double __y, long double __z) 01280 { return __builtin_fmal(__x, __y, __z); } 01281 01282 template<typename _Tp, typename _Up, typename _Vp> 01283 inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type 01284 fma(_Tp __x, _Up __y, _Vp __z) 01285 { 01286 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; 01287 return fma(__type(__x), __type(__y), __type(__z)); 01288 } 01289 01290 inline float 01291 fmax(float __x, float __y) 01292 { return __builtin_fmaxf(__x, __y); } 01293 01294 inline long double 01295 fmax(long double __x, long double __y) 01296 { return __builtin_fmaxl(__x, __y); } 01297 01298 template<typename _Tp, typename _Up> 01299 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01300 fmax(_Tp __x, _Up __y) 01301 { 01302 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01303 return fmax(__type(__x), __type(__y)); 01304 } 01305 01306 inline float 01307 fmin(float __x, float __y) 01308 { return __builtin_fminf(__x, __y); } 01309 01310 inline long double 01311 fmin(long double __x, long double __y) 01312 { return __builtin_fminl(__x, __y); } 01313 01314 template<typename _Tp, typename _Up> 01315 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01316 fmin(_Tp __x, _Up __y) 01317 { 01318 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01319 return fmin(__type(__x), __type(__y)); 01320 } 01321 01322 inline float 01323 hypot(float __x, float __y) 01324 { return __builtin_hypotf(__x, __y); } 01325 01326 inline long double 01327 hypot(long double __x, long double __y) 01328 { return __builtin_hypotl(__x, __y); } 01329 01330 template<typename _Tp, typename _Up> 01331 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01332 hypot(_Tp __x, _Up __y) 01333 { 01334 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01335 return hypot(__type(__x), __type(__y)); 01336 } 01337 01338 inline int 01339 ilogb(float __x) 01340 { return __builtin_ilogbf(__x); } 01341 01342 inline int 01343 ilogb(long double __x) 01344 { return __builtin_ilogbl(__x); } 01345 01346 template<typename _Tp> 01347 inline int 01348 ilogb(_Tp __x) 01349 { 01350 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01351 return ilogb(__type(__x)); 01352 } 01353 01354 inline float 01355 lgamma(float __x) 01356 { return __builtin_lgammaf(__x); } 01357 01358 inline long double 01359 lgamma(long double __x) 01360 { return __builtin_lgammal(__x); } 01361 01362 template<typename _Tp> 01363 inline typename __gnu_cxx::__promote<_Tp>::__type 01364 lgamma(_Tp __x) 01365 { 01366 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01367 return lgamma(__type(__x)); 01368 } 01369 01370 inline long long 01371 llrint(float __x) 01372 { return __builtin_llrintf(__x); } 01373 01374 inline long long 01375 llrint(long double __x) 01376 { return __builtin_llrintl(__x); } 01377 01378 template<typename _Tp> 01379 inline long long 01380 llrint(_Tp __x) 01381 { 01382 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01383 return llrint(__type(__x)); 01384 } 01385 01386 inline long long 01387 llround(float __x) 01388 { return __builtin_llroundf(__x); } 01389 01390 inline long long 01391 llround(long double __x) 01392 { return __builtin_llroundl(__x); } 01393 01394 template<typename _Tp> 01395 inline long long 01396 llround(_Tp __x) 01397 { 01398 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01399 return llround(__type(__x)); 01400 } 01401 01402 inline float 01403 log1p(float __x) 01404 { return __builtin_log1pf(__x); } 01405 01406 inline long double 01407 log1p(long double __x) 01408 { return __builtin_log1pl(__x); } 01409 01410 template<typename _Tp> 01411 inline typename __gnu_cxx::__promote<_Tp>::__type 01412 log1p(_Tp __x) 01413 { 01414 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01415 return log1p(__type(__x)); 01416 } 01417 01418 // DR 568. 01419 inline float 01420 log2(float __x) 01421 { return __builtin_log2f(__x); } 01422 01423 inline long double 01424 log2(long double __x) 01425 { return __builtin_log2l(__x); } 01426 01427 template<typename _Tp> 01428 inline typename __gnu_cxx::__promote<_Tp>::__type 01429 log2(_Tp __x) 01430 { 01431 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01432 return log2(__type(__x)); 01433 } 01434 01435 inline float 01436 logb(float __x) 01437 { return __builtin_logbf(__x); } 01438 01439 inline long double 01440 logb(long double __x) 01441 { return __builtin_logbl(__x); } 01442 01443 template<typename _Tp> 01444 inline typename __gnu_cxx::__promote<_Tp>::__type 01445 logb(_Tp __x) 01446 { 01447 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01448 return logb(__type(__x)); 01449 } 01450 01451 inline long 01452 lrint(float __x) 01453 { return __builtin_lrintf(__x); } 01454 01455 inline long 01456 lrint(long double __x) 01457 { return __builtin_lrintl(__x); } 01458 01459 template<typename _Tp> 01460 inline long 01461 lrint(_Tp __x) 01462 { 01463 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01464 return lrint(__type(__x)); 01465 } 01466 01467 inline long 01468 lround(float __x) 01469 { return __builtin_lroundf(__x); } 01470 01471 inline long 01472 lround(long double __x) 01473 { return __builtin_lroundl(__x); } 01474 01475 template<typename _Tp> 01476 inline long 01477 lround(_Tp __x) 01478 { 01479 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01480 return lround(__type(__x)); 01481 } 01482 01483 inline float 01484 nearbyint(float __x) 01485 { return __builtin_nearbyintf(__x); } 01486 01487 inline long double 01488 nearbyint(long double __x) 01489 { return __builtin_nearbyintl(__x); } 01490 01491 template<typename _Tp> 01492 inline typename __gnu_cxx::__promote<_Tp>::__type 01493 nearbyint(_Tp __x) 01494 { 01495 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01496 return nearbyint(__type(__x)); 01497 } 01498 01499 inline float 01500 nextafter(float __x, float __y) 01501 { return __builtin_nextafterf(__x, __y); } 01502 01503 inline long double 01504 nextafter(long double __x, long double __y) 01505 { return __builtin_nextafterl(__x, __y); } 01506 01507 template<typename _Tp, typename _Up> 01508 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01509 nextafter(_Tp __x, _Up __y) 01510 { 01511 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01512 return nextafter(__type(__x), __type(__y)); 01513 } 01514 01515 inline float 01516 nexttoward(float __x, long double __y) 01517 { return __builtin_nexttowardf(__x, __y); } 01518 01519 inline long double 01520 nexttoward(long double __x, long double __y) 01521 { return __builtin_nexttowardl(__x, __y); } 01522 01523 template<typename _Tp> 01524 inline typename __gnu_cxx::__promote<_Tp>::__type 01525 nexttoward(_Tp __x, long double __y) 01526 { 01527 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01528 return nexttoward(__type(__x), __y); 01529 } 01530 01531 inline float 01532 remainder(float __x, float __y) 01533 { return __builtin_remainderf(__x, __y); } 01534 01535 inline long double 01536 remainder(long double __x, long double __y) 01537 { return __builtin_remainderl(__x, __y); } 01538 01539 template<typename _Tp, typename _Up> 01540 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01541 remainder(_Tp __x, _Up __y) 01542 { 01543 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01544 return remainder(__type(__x), __type(__y)); 01545 } 01546 01547 inline float 01548 remquo(float __x, float __y, int* __pquo) 01549 { return __builtin_remquof(__x, __y, __pquo); } 01550 01551 inline long double 01552 remquo(long double __x, long double __y, int* __pquo) 01553 { return __builtin_remquol(__x, __y, __pquo); } 01554 01555 template<typename _Tp, typename _Up> 01556 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01557 remquo(_Tp __x, _Up __y, int* __pquo) 01558 { 01559 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01560 return remquo(__type(__x), __type(__y), __pquo); 01561 } 01562 01563 inline float 01564 rint(float __x) 01565 { return __builtin_rintf(__x); } 01566 01567 inline long double 01568 rint(long double __x) 01569 { return __builtin_rintl(__x); } 01570 01571 template<typename _Tp> 01572 inline typename __gnu_cxx::__promote<_Tp>::__type 01573 rint(_Tp __x) 01574 { 01575 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01576 return rint(__type(__x)); 01577 } 01578 01579 inline float 01580 round(float __x) 01581 { return __builtin_roundf(__x); } 01582 01583 inline long double 01584 round(long double __x) 01585 { return __builtin_roundl(__x); } 01586 01587 template<typename _Tp> 01588 inline typename __gnu_cxx::__promote<_Tp>::__type 01589 round(_Tp __x) 01590 { 01591 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01592 return round(__type(__x)); 01593 } 01594 01595 inline float 01596 scalbln(float __x, long __ex) 01597 { return __builtin_scalblnf(__x, __ex); } 01598 01599 inline long double 01600 scalbln(long double __x, long __ex) 01601 { return __builtin_scalblnl(__x, __ex); } 01602 01603 template<typename _Tp> 01604 inline typename __gnu_cxx::__promote<_Tp>::__type 01605 scalbln(_Tp __x, long __ex) 01606 { 01607 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01608 return scalbln(__type(__x), __ex); 01609 } 01610 01611 inline float 01612 scalbn(float __x, int __ex) 01613 { return __builtin_scalbnf(__x, __ex); } 01614 01615 inline long double 01616 scalbn(long double __x, int __ex) 01617 { return __builtin_scalbnl(__x, __ex); } 01618 01619 template<typename _Tp> 01620 inline typename __gnu_cxx::__promote<_Tp>::__type 01621 scalbn(_Tp __x, int __ex) 01622 { 01623 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01624 return scalbn(__type(__x), __ex); 01625 } 01626 01627 inline float 01628 tgamma(float __x) 01629 { return __builtin_tgammaf(__x); } 01630 01631 inline long double 01632 tgamma(long double __x) 01633 { return __builtin_tgammal(__x); } 01634 01635 template<typename _Tp> 01636 inline typename __gnu_cxx::__promote<_Tp>::__type 01637 tgamma(_Tp __x) 01638 { 01639 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01640 return tgamma(__type(__x)); 01641 } 01642 01643 inline float 01644 trunc(float __x) 01645 { return __builtin_truncf(__x); } 01646 01647 inline long double 01648 trunc(long double __x) 01649 { return __builtin_truncl(__x); } 01650 01651 template<typename _Tp> 01652 inline typename __gnu_cxx::__promote<_Tp>::__type 01653 trunc(_Tp __x) 01654 { 01655 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01656 return trunc(__type(__x)); 01657 } 01658 01659 _GLIBCXX_END_NAMESPACE_VERSION 01660 } // namespace 01661 01662 #endif // _GLIBCXX_USE_C99_MATH_TR1 01663 01664 #endif // __GXX_EXPERIMENTAL_CXX0X__ 01665 01666 #endif