1 // -*- C++ -*- C forwarding header. 2 3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 4 // 2006, 2007, 2008, 2009, 2010, 2011 5 // Free Software Foundation, Inc. 6 // 7 // This file is part of the GNU ISO C++ Library. This library is free 8 // software; you can redistribute it and/or modify it under the 9 // terms of the GNU General Public License as published by the 10 // Free Software Foundation; either version 3, or (at your option) 11 // any later version. 12 13 // This library is distributed in the hope that it will be useful, 14 // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 // GNU General Public License for more details. 17 18 // Under Section 7 of GPL version 3, you are granted additional 19 // permissions described in the GCC Runtime Library Exception, version 20 // 3.1, as published by the Free Software Foundation. 21 22 // You should have received a copy of the GNU General Public License and 23 // a copy of the GCC Runtime Library Exception along with this program; 24 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 25 // <http://www.gnu.org/licenses/>. 26 27 /** @file include/cmath 28 * This is a Standard C++ Library file. You should @c \#include this file 29 * in your programs, rather than any of the @a *.h implementation files. 30 * 31 * This is the C++ version of the Standard C Library header @c math.h, 32 * and its contents are (mostly) the same as that header, but are all 33 * contained in the namespace @c std (except for names which are defined 34 * as macros in C). 35 */ 36 37 // 38 // ISO C++ 14882: 26.5 C library 39 // 40 41 #pragma GCC system_header 42 43 #include <bits/c++config.h> 44 #include <bits/cpp_type_traits.h> 45 #include <ext/type_traits.h> 46 #include <math.h> 47 48 #ifndef _GLIBCXX_CMATH 49 #define _GLIBCXX_CMATH 1 50 51 // Get rid of those macros defined in <math.h> in lieu of real functions. 52 #undef abs 53 #undef div 54 #undef acos 55 #undef asin 56 #undef atan 57 #undef atan2 58 #undef ceil 59 #undef cos 60 #undef cosh 61 #undef exp 62 #undef fabs 63 #undef floor 64 #undef fmod 65 #undef frexp 66 #undef ldexp 67 #undef log 68 #undef log10 69 #undef modf 70 #undef pow 71 #undef sin 72 #undef sinh 73 #undef sqrt 74 #undef tan 75 #undef tanh 76 77 namespace std _GLIBCXX_VISIBILITY(default) 78 { 79 _GLIBCXX_BEGIN_NAMESPACE_VERSION 80 81 inline double 82 abs(double __x) 83 { return __builtin_fabs(__x); } 84 85 inline float 86 abs(float __x) 87 { return __builtin_fabsf(__x); } 88 89 inline long double 90 abs(long double __x) 91 { return __builtin_fabsl(__x); } 92 93 template<typename _Tp> 94 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 95 double>::__type 96 abs(_Tp __x) 97 { return __builtin_fabs(__x); } 98 99 using ::acos; 100 101 inline float 102 acos(float __x) 103 { return __builtin_acosf(__x); } 104 105 inline long double 106 acos(long double __x) 107 { return __builtin_acosl(__x); } 108 109 template<typename _Tp> 110 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 111 double>::__type 112 acos(_Tp __x) 113 { return __builtin_acos(__x); } 114 115 using ::asin; 116 117 inline float 118 asin(float __x) 119 { return __builtin_asinf(__x); } 120 121 inline long double 122 asin(long double __x) 123 { return __builtin_asinl(__x); } 124 125 template<typename _Tp> 126 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 127 double>::__type 128 asin(_Tp __x) 129 { return __builtin_asin(__x); } 130 131 using ::atan; 132 133 inline float 134 atan(float __x) 135 { return __builtin_atanf(__x); } 136 137 inline long double 138 atan(long double __x) 139 { return __builtin_atanl(__x); } 140 141 template<typename _Tp> 142 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 143 double>::__type 144 atan(_Tp __x) 145 { return __builtin_atan(__x); } 146 147 using ::atan2; 148 149 inline float 150 atan2(float __y, float __x) 151 { return __builtin_atan2f(__y, __x); } 152 153 inline long double 154 atan2(long double __y, long double __x) 155 { return __builtin_atan2l(__y, __x); } 156 157 template<typename _Tp, typename _Up> 158 inline 159 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 160 atan2(_Tp __y, _Up __x) 161 { 162 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 163 return atan2(__type(__y), __type(__x)); 164 } 165 166 using ::ceil; 167 168 inline float 169 ceil(float __x) 170 { return __builtin_ceilf(__x); } 171 172 inline long double 173 ceil(long double __x) 174 { return __builtin_ceill(__x); } 175 176 template<typename _Tp> 177 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 178 double>::__type 179 ceil(_Tp __x) 180 { return __builtin_ceil(__x); } 181 182 using ::cos; 183 184 inline float 185 cos(float __x) 186 { return __builtin_cosf(__x); } 187 188 inline long double 189 cos(long double __x) 190 { return __builtin_cosl(__x); } 191 192 template<typename _Tp> 193 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 194 double>::__type 195 cos(_Tp __x) 196 { return __builtin_cos(__x); } 197 198 using ::cosh; 199 200 inline float 201 cosh(float __x) 202 { return __builtin_coshf(__x); } 203 204 inline long double 205 cosh(long double __x) 206 { return __builtin_coshl(__x); } 207 208 template<typename _Tp> 209 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 210 double>::__type 211 cosh(_Tp __x) 212 { return __builtin_cosh(__x); } 213 214 using ::exp; 215 216 inline float 217 exp(float __x) 218 { return __builtin_expf(__x); } 219 220 inline long double 221 exp(long double __x) 222 { return __builtin_expl(__x); } 223 224 template<typename _Tp> 225 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 226 double>::__type 227 exp(_Tp __x) 228 { return __builtin_exp(__x); } 229 230 using ::fabs; 231 232 inline float 233 fabs(float __x) 234 { return __builtin_fabsf(__x); } 235 236 inline long double 237 fabs(long double __x) 238 { return __builtin_fabsl(__x); } 239 240 template<typename _Tp> 241 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 242 double>::__type 243 fabs(_Tp __x) 244 { return __builtin_fabs(__x); } 245 246 using ::floor; 247 248 inline float 249 floor(float __x) 250 { return __builtin_floorf(__x); } 251 252 inline long double 253 floor(long double __x) 254 { return __builtin_floorl(__x); } 255 256 template<typename _Tp> 257 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 258 double>::__type 259 floor(_Tp __x) 260 { return __builtin_floor(__x); } 261 262 using ::fmod; 263 264 inline float 265 fmod(float __x, float __y) 266 { return __builtin_fmodf(__x, __y); } 267 268 inline long double 269 fmod(long double __x, long double __y) 270 { return __builtin_fmodl(__x, __y); } 271 272 using ::frexp; 273 274 inline float 275 frexp(float __x, int* __exp) 276 { return __builtin_frexpf(__x, __exp); } 277 278 inline long double 279 frexp(long double __x, int* __exp) 280 { return __builtin_frexpl(__x, __exp); } 281 282 template<typename _Tp> 283 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 284 double>::__type 285 frexp(_Tp __x, int* __exp) 286 { return __builtin_frexp(__x, __exp); } 287 288 using ::ldexp; 289 290 inline float 291 ldexp(float __x, int __exp) 292 { return __builtin_ldexpf(__x, __exp); } 293 294 inline long double 295 ldexp(long double __x, int __exp) 296 { return __builtin_ldexpl(__x, __exp); } 297 298 template<typename _Tp> 299 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 300 double>::__type 301 ldexp(_Tp __x, int __exp) 302 { return __builtin_ldexp(__x, __exp); } 303 304 using ::log; 305 306 inline float 307 log(float __x) 308 { return __builtin_logf(__x); } 309 310 inline long double 311 log(long double __x) 312 { return __builtin_logl(__x); } 313 314 template<typename _Tp> 315 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 316 double>::__type 317 log(_Tp __x) 318 { return __builtin_log(__x); } 319 320 using ::log10; 321 322 inline float 323 log10(float __x) 324 { return __builtin_log10f(__x); } 325 326 inline long double 327 log10(long double __x) 328 { return __builtin_log10l(__x); } 329 330 template<typename _Tp> 331 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 332 double>::__type 333 log10(_Tp __x) 334 { return __builtin_log10(__x); } 335 336 using ::modf; 337 338 inline float 339 modf(float __x, float* __iptr) 340 { return __builtin_modff(__x, __iptr); } 341 342 inline long double 343 modf(long double __x, long double* __iptr) 344 { return __builtin_modfl(__x, __iptr); } 345 346 using ::pow; 347 348 inline float 349 pow(float __x, float __y) 350 { return __builtin_powf(__x, __y); } 351 352 inline long double 353 pow(long double __x, long double __y) 354 { return __builtin_powl(__x, __y); } 355 356 #ifndef __GXX_EXPERIMENTAL_CXX0X__ 357 // _GLIBCXX_RESOLVE_LIB_DEFECTS 358 // DR 550. What should the return type of pow(float,int) be? 359 inline double 360 pow(double __x, int __i) 361 { return __builtin_powi(__x, __i); } 362 363 inline float 364 pow(float __x, int __n) 365 { return __builtin_powif(__x, __n); } 366 367 inline long double 368 pow(long double __x, int __n) 369 { return __builtin_powil(__x, __n); } 370 #endif 371 372 template<typename _Tp, typename _Up> 373 inline 374 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 375 pow(_Tp __x, _Up __y) 376 { 377 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 378 return pow(__type(__x), __type(__y)); 379 } 380 381 using ::sin; 382 383 inline float 384 sin(float __x) 385 { return __builtin_sinf(__x); } 386 387 inline long double 388 sin(long double __x) 389 { return __builtin_sinl(__x); } 390 391 template<typename _Tp> 392 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 393 double>::__type 394 sin(_Tp __x) 395 { return __builtin_sin(__x); } 396 397 using ::sinh; 398 399 inline float 400 sinh(float __x) 401 { return __builtin_sinhf(__x); } 402 403 inline long double 404 sinh(long double __x) 405 { return __builtin_sinhl(__x); } 406 407 template<typename _Tp> 408 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 409 double>::__type 410 sinh(_Tp __x) 411 { return __builtin_sinh(__x); } 412 413 using ::sqrt; 414 415 inline float 416 sqrt(float __x) 417 { return __builtin_sqrtf(__x); } 418 419 inline long double 420 sqrt(long double __x) 421 { return __builtin_sqrtl(__x); } 422 423 template<typename _Tp> 424 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 425 double>::__type 426 sqrt(_Tp __x) 427 { return __builtin_sqrt(__x); } 428 429 using ::tan; 430 431 inline float 432 tan(float __x) 433 { return __builtin_tanf(__x); } 434 435 inline long double 436 tan(long double __x) 437 { return __builtin_tanl(__x); } 438 439 template<typename _Tp> 440 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 441 double>::__type 442 tan(_Tp __x) 443 { return __builtin_tan(__x); } 444 445 using ::tanh; 446 447 inline float 448 tanh(float __x) 449 { return __builtin_tanhf(__x); } 450 451 inline long double 452 tanh(long double __x) 453 { return __builtin_tanhl(__x); } 454 455 template<typename _Tp> 456 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 457 double>::__type 458 tanh(_Tp __x) 459 { return __builtin_tanh(__x); } 460 461 _GLIBCXX_END_NAMESPACE_VERSION 462 } // namespace 463 464 #if _GLIBCXX_USE_C99_MATH 465 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 466 467 // These are possible macros imported from C99-land. 468 #undef fpclassify 469 #undef isfinite 470 #undef isinf 471 #undef isnan 472 #undef isnormal 473 #undef signbit 474 #undef isgreater 475 #undef isgreaterequal 476 #undef isless 477 #undef islessequal 478 #undef islessgreater 479 #undef isunordered 480 481 namespace std _GLIBCXX_VISIBILITY(default) 482 { 483 _GLIBCXX_BEGIN_NAMESPACE_VERSION 484 485 #ifdef __GXX_EXPERIMENTAL_CXX0X__ 486 inline int 487 fpclassify(float __x) 488 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 489 FP_SUBNORMAL, FP_ZERO, __x); } 490 491 inline int 492 fpclassify(double __x) 493 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 494 FP_SUBNORMAL, FP_ZERO, __x); } 495 496 inline int 497 fpclassify(long double __x) 498 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 499 FP_SUBNORMAL, FP_ZERO, __x); } 500 501 template<typename _Tp> 502 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 503 int>::__type 504 fpclassify(_Tp __x) 505 { return __x != 0 ? FP_NORMAL : FP_ZERO; } 506 507 inline bool 508 isfinite(float __x) 509 { return __builtin_isfinite(__x); } 510 511 inline bool 512 isfinite(double __x) 513 { return __builtin_isfinite(__x); } 514 515 inline bool 516 isfinite(long double __x) 517 { return __builtin_isfinite(__x); } 518 519 template<typename _Tp> 520 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 521 bool>::__type 522 isfinite(_Tp __x) 523 { return true; } 524 525 inline bool 526 isinf(float __x) 527 { return __builtin_isinf(__x); } 528 529 inline bool 530 isinf(double __x) 531 { return __builtin_isinf(__x); } 532 533 inline bool 534 isinf(long double __x) 535 { return __builtin_isinf(__x); } 536 537 template<typename _Tp> 538 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 539 bool>::__type 540 isinf(_Tp __x) 541 { return false; } 542 543 inline bool 544 isnan(float __x) 545 { return __builtin_isnan(__x); } 546 547 inline bool 548 isnan(double __x) 549 { return __builtin_isnan(__x); } 550 551 inline bool 552 isnan(long double __x) 553 { return __builtin_isnan(__x); } 554 555 template<typename _Tp> 556 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 557 bool>::__type 558 isnan(_Tp __x) 559 { return false; } 560 561 inline bool 562 isnormal(float __x) 563 { return __builtin_isnormal(__x); } 564 565 inline bool 566 isnormal(double __x) 567 { return __builtin_isnormal(__x); } 568 569 inline bool 570 isnormal(long double __x) 571 { return __builtin_isnormal(__x); } 572 573 template<typename _Tp> 574 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 575 bool>::__type 576 isnormal(_Tp __x) 577 { return __x != 0 ? true : false; } 578 579 inline bool 580 signbit(float __x) 581 { return __builtin_signbit(__x); } 582 583 inline bool 584 signbit(double __x) 585 { return __builtin_signbit(__x); } 586 587 inline bool 588 signbit(long double __x) 589 { return __builtin_signbit(__x); } 590 591 template<typename _Tp> 592 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 593 bool>::__type 594 signbit(_Tp __x) 595 { return __x < 0 ? true : false; } 596 597 inline bool 598 isgreater(float __x, float __y) 599 { return __builtin_isgreater(__x, __y); } 600 601 inline bool 602 isgreater(double __x, double __y) 603 { return __builtin_isgreater(__x, __y); } 604 605 inline bool 606 isgreater(long double __x, long double __y) 607 { return __builtin_isgreater(__x, __y); } 608 609 template<typename _Tp, typename _Up> 610 inline typename 611 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 612 && __is_arithmetic<_Up>::__value), bool>::__type 613 isgreater(_Tp __x, _Up __y) 614 { 615 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 616 return __builtin_isgreater(__type(__x), __type(__y)); 617 } 618 619 inline bool 620 isgreaterequal(float __x, float __y) 621 { return __builtin_isgreaterequal(__x, __y); } 622 623 inline bool 624 isgreaterequal(double __x, double __y) 625 { return __builtin_isgreaterequal(__x, __y); } 626 627 inline bool 628 isgreaterequal(long double __x, long double __y) 629 { return __builtin_isgreaterequal(__x, __y); } 630 631 template<typename _Tp, typename _Up> 632 inline typename 633 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 634 && __is_arithmetic<_Up>::__value), bool>::__type 635 isgreaterequal(_Tp __x, _Up __y) 636 { 637 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 638 return __builtin_isgreaterequal(__type(__x), __type(__y)); 639 } 640 641 inline bool 642 isless(float __x, float __y) 643 { return __builtin_isless(__x, __y); } 644 645 inline bool 646 isless(double __x, double __y) 647 { return __builtin_isless(__x, __y); } 648 649 inline bool 650 isless(long double __x, long double __y) 651 { return __builtin_isless(__x, __y); } 652 653 template<typename _Tp, typename _Up> 654 inline typename 655 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 656 && __is_arithmetic<_Up>::__value), bool>::__type 657 isless(_Tp __x, _Up __y) 658 { 659 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 660 return __builtin_isless(__type(__x), __type(__y)); 661 } 662 663 inline bool 664 islessequal(float __x, float __y) 665 { return __builtin_islessequal(__x, __y); } 666 667 inline bool 668 islessequal(double __x, double __y) 669 { return __builtin_islessequal(__x, __y); } 670 671 inline bool 672 islessequal(long double __x, long double __y) 673 { return __builtin_islessequal(__x, __y); } 674 675 template<typename _Tp, typename _Up> 676 inline typename 677 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 678 && __is_arithmetic<_Up>::__value), bool>::__type 679 islessequal(_Tp __x, _Up __y) 680 { 681 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 682 return __builtin_islessequal(__type(__x), __type(__y)); 683 } 684 685 inline bool 686 islessgreater(float __x, float __y) 687 { return __builtin_islessgreater(__x, __y); } 688 689 inline bool 690 islessgreater(double __x, double __y) 691 { return __builtin_islessgreater(__x, __y); } 692 693 inline bool 694 islessgreater(long double __x, long double __y) 695 { return __builtin_islessgreater(__x, __y); } 696 697 template<typename _Tp, typename _Up> 698 inline typename 699 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 700 && __is_arithmetic<_Up>::__value), bool>::__type 701 islessgreater(_Tp __x, _Up __y) 702 { 703 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 704 return __builtin_islessgreater(__type(__x), __type(__y)); 705 } 706 707 inline bool 708 isunordered(float __x, float __y) 709 { return __builtin_isunordered(__x, __y); } 710 711 inline bool 712 isunordered(double __x, double __y) 713 { return __builtin_isunordered(__x, __y); } 714 715 inline bool 716 isunordered(long double __x, long double __y) 717 { return __builtin_isunordered(__x, __y); } 718 719 template<typename _Tp, typename _Up> 720 inline typename 721 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value 722 && __is_arithmetic<_Up>::__value), bool>::__type 723 isunordered(_Tp __x, _Up __y) 724 { 725 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 726 return __builtin_isunordered(__type(__x), __type(__y)); 727 } 728 729 #else 730 731 template<typename _Tp> 732 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 733 int>::__type 734 fpclassify(_Tp __f) 735 { 736 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 737 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 738 FP_SUBNORMAL, FP_ZERO, __type(__f)); 739 } 740 741 template<typename _Tp> 742 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 743 int>::__type 744 isfinite(_Tp __f) 745 { 746 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 747 return __builtin_isfinite(__type(__f)); 748 } 749 750 template<typename _Tp> 751 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 752 int>::__type 753 isinf(_Tp __f) 754 { 755 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 756 return __builtin_isinf(__type(__f)); 757 } 758 759 template<typename _Tp> 760 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 761 int>::__type 762 isnan(_Tp __f) 763 { 764 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 765 return __builtin_isnan(__type(__f)); 766 } 767 768 template<typename _Tp> 769 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 770 int>::__type 771 isnormal(_Tp __f) 772 { 773 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 774 return __builtin_isnormal(__type(__f)); 775 } 776 777 template<typename _Tp> 778 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 779 int>::__type 780 signbit(_Tp __f) 781 { 782 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 783 return __builtin_signbit(__type(__f)); 784 } 785 786 template<typename _Tp> 787 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 788 int>::__type 789 isgreater(_Tp __f1, _Tp __f2) 790 { 791 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 792 return __builtin_isgreater(__type(__f1), __type(__f2)); 793 } 794 795 template<typename _Tp> 796 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 797 int>::__type 798 isgreaterequal(_Tp __f1, _Tp __f2) 799 { 800 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 801 return __builtin_isgreaterequal(__type(__f1), __type(__f2)); 802 } 803 804 template<typename _Tp> 805 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 806 int>::__type 807 isless(_Tp __f1, _Tp __f2) 808 { 809 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 810 return __builtin_isless(__type(__f1), __type(__f2)); 811 } 812 813 template<typename _Tp> 814 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 815 int>::__type 816 islessequal(_Tp __f1, _Tp __f2) 817 { 818 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 819 return __builtin_islessequal(__type(__f1), __type(__f2)); 820 } 821 822 template<typename _Tp> 823 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 824 int>::__type 825 islessgreater(_Tp __f1, _Tp __f2) 826 { 827 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 828 return __builtin_islessgreater(__type(__f1), __type(__f2)); 829 } 830 831 template<typename _Tp> 832 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 833 int>::__type 834 isunordered(_Tp __f1, _Tp __f2) 835 { 836 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 837 return __builtin_isunordered(__type(__f1), __type(__f2)); 838 } 839 840 #endif 841 842 _GLIBCXX_END_NAMESPACE_VERSION 843 } // namespace 844 845 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ 846 #endif 847 848 #ifdef __GXX_EXPERIMENTAL_CXX0X__ 849 850 #ifdef _GLIBCXX_USE_C99_MATH_TR1 851 852 #undef acosh 853 #undef acoshf 854 #undef acoshl 855 #undef asinh 856 #undef asinhf 857 #undef asinhl 858 #undef atanh 859 #undef atanhf 860 #undef atanhl 861 #undef cbrt 862 #undef cbrtf 863 #undef cbrtl 864 #undef copysign 865 #undef copysignf 866 #undef copysignl 867 #undef erf 868 #undef erff 869 #undef erfl 870 #undef erfc 871 #undef erfcf 872 #undef erfcl 873 #undef exp2 874 #undef exp2f 875 #undef exp2l 876 #undef expm1 877 #undef expm1f 878 #undef expm1l 879 #undef fdim 880 #undef fdimf 881 #undef fdiml 882 #undef fma 883 #undef fmaf 884 #undef fmal 885 #undef fmax 886 #undef fmaxf 887 #undef fmaxl 888 #undef fmin 889 #undef fminf 890 #undef fminl 891 #undef hypot 892 #undef hypotf 893 #undef hypotl 894 #undef ilogb 895 #undef ilogbf 896 #undef ilogbl 897 #undef lgamma 898 #undef lgammaf 899 #undef lgammal 900 #undef llrint 901 #undef llrintf 902 #undef llrintl 903 #undef llround 904 #undef llroundf 905 #undef llroundl 906 #undef log1p 907 #undef log1pf 908 #undef log1pl 909 #undef log2 910 #undef log2f 911 #undef log2l 912 #undef logb 913 #undef logbf 914 #undef logbl 915 #undef lrint 916 #undef lrintf 917 #undef lrintl 918 #undef lround 919 #undef lroundf 920 #undef lroundl 921 #undef nan 922 #undef nanf 923 #undef nanl 924 #undef nearbyint 925 #undef nearbyintf 926 #undef nearbyintl 927 #undef nextafter 928 #undef nextafterf 929 #undef nextafterl 930 #undef nexttoward 931 #undef nexttowardf 932 #undef nexttowardl 933 #undef remainder 934 #undef remainderf 935 #undef remainderl 936 #undef remquo 937 #undef remquof 938 #undef remquol 939 #undef rint 940 #undef rintf 941 #undef rintl 942 #undef round 943 #undef roundf 944 #undef roundl 945 #undef scalbln 946 #undef scalblnf 947 #undef scalblnl 948 #undef scalbn 949 #undef scalbnf 950 #undef scalbnl 951 #undef tgamma 952 #undef tgammaf 953 #undef tgammal 954 #undef trunc 955 #undef truncf 956 #undef truncl 957 958 namespace std _GLIBCXX_VISIBILITY(default) 959 { 960 _GLIBCXX_BEGIN_NAMESPACE_VERSION 961 962 // types 963 using ::double_t; 964 using ::float_t; 965 966 // functions 967 using ::acosh; 968 using ::acoshf; 969 using ::acoshl; 970 971 using ::asinh; 972 using ::asinhf; 973 using ::asinhl; 974 975 using ::atanh; 976 using ::atanhf; 977 using ::atanhl; 978 979 using ::cbrt; 980 using ::cbrtf; 981 using ::cbrtl; 982 983 using ::copysign; 984 using ::copysignf; 985 using ::copysignl; 986 987 using ::erf; 988 using ::erff; 989 using ::erfl; 990 991 using ::erfc; 992 using ::erfcf; 993 using ::erfcl; 994 995 using ::exp2; 996 using ::exp2f; 997 using ::exp2l; 998 999 using ::expm1; 1000 using ::expm1f; 1001 using ::expm1l; 1002 1003 using ::fdim; 1004 using ::fdimf; 1005 using ::fdiml; 1006 1007 using ::fma; 1008 using ::fmaf; 1009 using ::fmal; 1010 1011 using ::fmax; 1012 using ::fmaxf; 1013 using ::fmaxl; 1014 1015 using ::fmin; 1016 using ::fminf; 1017 using ::fminl; 1018 1019 using ::hypot; 1020 using ::hypotf; 1021 using ::hypotl; 1022 1023 using ::ilogb; 1024 using ::ilogbf; 1025 using ::ilogbl; 1026 1027 using ::lgamma; 1028 using ::lgammaf; 1029 using ::lgammal; 1030 1031 using ::llrint; 1032 using ::llrintf; 1033 using ::llrintl; 1034 1035 using ::llround; 1036 using ::llroundf; 1037 using ::llroundl; 1038 1039 using ::log1p; 1040 using ::log1pf; 1041 using ::log1pl; 1042 1043 using ::log2; 1044 using ::log2f; 1045 using ::log2l; 1046 1047 using ::logb; 1048 using ::logbf; 1049 using ::logbl; 1050 1051 using ::lrint; 1052 using ::lrintf; 1053 using ::lrintl; 1054 1055 using ::lround; 1056 using ::lroundf; 1057 using ::lroundl; 1058 1059 using ::nan; 1060 using ::nanf; 1061 using ::nanl; 1062 1063 using ::nearbyint; 1064 using ::nearbyintf; 1065 using ::nearbyintl; 1066 1067 using ::nextafter; 1068 using ::nextafterf; 1069 using ::nextafterl; 1070 1071 using ::nexttoward; 1072 using ::nexttowardf; 1073 using ::nexttowardl; 1074 1075 using ::remainder; 1076 using ::remainderf; 1077 using ::remainderl; 1078 1079 using ::remquo; 1080 using ::remquof; 1081 using ::remquol; 1082 1083 using ::rint; 1084 using ::rintf; 1085 using ::rintl; 1086 1087 using ::round; 1088 using ::roundf; 1089 using ::roundl; 1090 1091 using ::scalbln; 1092 using ::scalblnf; 1093 using ::scalblnl; 1094 1095 using ::scalbn; 1096 using ::scalbnf; 1097 using ::scalbnl; 1098 1099 using ::tgamma; 1100 using ::tgammaf; 1101 using ::tgammal; 1102 1103 using ::trunc; 1104 using ::truncf; 1105 using ::truncl; 1106 1107 /// Additional overloads. 1108 inline float 1109 acosh(float __x) 1110 { return __builtin_acoshf(__x); } 1111 1112 inline long double 1113 acosh(long double __x) 1114 { return __builtin_acoshl(__x); } 1115 1116 template<typename _Tp> 1117 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1118 double>::__type 1119 acosh(_Tp __x) 1120 { return __builtin_acosh(__x); } 1121 1122 inline float 1123 asinh(float __x) 1124 { return __builtin_asinhf(__x); } 1125 1126 inline long double 1127 asinh(long double __x) 1128 { return __builtin_asinhl(__x); } 1129 1130 template<typename _Tp> 1131 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1132 double>::__type 1133 asinh(_Tp __x) 1134 { return __builtin_asinh(__x); } 1135 1136 inline float 1137 atanh(float __x) 1138 { return __builtin_atanhf(__x); } 1139 1140 inline long double 1141 atanh(long double __x) 1142 { return __builtin_atanhl(__x); } 1143 1144 template<typename _Tp> 1145 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1146 double>::__type 1147 atanh(_Tp __x) 1148 { return __builtin_atanh(__x); } 1149 1150 inline float 1151 cbrt(float __x) 1152 { return __builtin_cbrtf(__x); } 1153 1154 inline long double 1155 cbrt(long double __x) 1156 { return __builtin_cbrtl(__x); } 1157 1158 template<typename _Tp> 1159 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1160 double>::__type 1161 cbrt(_Tp __x) 1162 { return __builtin_cbrt(__x); } 1163 1164 inline float 1165 copysign(float __x, float __y) 1166 { return __builtin_copysignf(__x, __y); } 1167 1168 inline long double 1169 copysign(long double __x, long double __y) 1170 { return __builtin_copysignl(__x, __y); } 1171 1172 template<typename _Tp, typename _Up> 1173 inline 1174 typename __gnu_cxx::__promote_2< 1175 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1176 && __is_arithmetic<_Up>::__value, 1177 _Tp>::__type, _Up>::__type 1178 copysign(_Tp __x, _Up __y) 1179 { 1180 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1181 return copysign(__type(__x), __type(__y)); 1182 } 1183 1184 inline float 1185 erf(float __x) 1186 { return __builtin_erff(__x); } 1187 1188 inline long double 1189 erf(long double __x) 1190 { return __builtin_erfl(__x); } 1191 1192 template<typename _Tp> 1193 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1194 double>::__type 1195 erf(_Tp __x) 1196 { return __builtin_erf(__x); } 1197 1198 inline float 1199 erfc(float __x) 1200 { return __builtin_erfcf(__x); } 1201 1202 inline long double 1203 erfc(long double __x) 1204 { return __builtin_erfcl(__x); } 1205 1206 template<typename _Tp> 1207 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1208 double>::__type 1209 erfc(_Tp __x) 1210 { return __builtin_erfc(__x); } 1211 1212 inline float 1213 exp2(float __x) 1214 { return __builtin_exp2f(__x); } 1215 1216 inline long double 1217 exp2(long double __x) 1218 { return __builtin_exp2l(__x); } 1219 1220 template<typename _Tp> 1221 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1222 double>::__type 1223 exp2(_Tp __x) 1224 { return __builtin_exp2(__x); } 1225 1226 inline float 1227 expm1(float __x) 1228 { return __builtin_expm1f(__x); } 1229 1230 inline long double 1231 expm1(long double __x) 1232 { return __builtin_expm1l(__x); } 1233 1234 template<typename _Tp> 1235 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1236 double>::__type 1237 expm1(_Tp __x) 1238 { return __builtin_expm1(__x); } 1239 1240 inline float 1241 fdim(float __x, float __y) 1242 { return __builtin_fdimf(__x, __y); } 1243 1244 inline long double 1245 fdim(long double __x, long double __y) 1246 { return __builtin_fdiml(__x, __y); } 1247 1248 template<typename _Tp, typename _Up> 1249 inline 1250 typename __gnu_cxx::__promote_2< 1251 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1252 && __is_arithmetic<_Up>::__value, 1253 _Tp>::__type, _Up>::__type 1254 fdim(_Tp __x, _Up __y) 1255 { 1256 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1257 return fdim(__type(__x), __type(__y)); 1258 } 1259 1260 inline float 1261 fma(float __x, float __y, float __z) 1262 { return __builtin_fmaf(__x, __y, __z); } 1263 1264 inline long double 1265 fma(long double __x, long double __y, long double __z) 1266 { return __builtin_fmal(__x, __y, __z); } 1267 1268 template<typename _Tp, typename _Up, typename _Vp> 1269 inline 1270 typename __gnu_cxx::__promote_3< 1271 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1272 && __is_arithmetic<_Up>::__value 1273 && __is_arithmetic<_Vp>::__value, 1274 _Tp>::__type, _Up, _Vp>::__type 1275 fma(_Tp __x, _Up __y, _Vp __z) 1276 { 1277 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; 1278 return fma(__type(__x), __type(__y), __type(__z)); 1279 } 1280 1281 inline float 1282 fmax(float __x, float __y) 1283 { return __builtin_fmaxf(__x, __y); } 1284 1285 inline long double 1286 fmax(long double __x, long double __y) 1287 { return __builtin_fmaxl(__x, __y); } 1288 1289 template<typename _Tp, typename _Up> 1290 inline 1291 typename __gnu_cxx::__promote_2< 1292 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1293 && __is_arithmetic<_Up>::__value, 1294 _Tp>::__type, _Up>::__type 1295 fmax(_Tp __x, _Up __y) 1296 { 1297 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1298 return fmax(__type(__x), __type(__y)); 1299 } 1300 1301 inline float 1302 fmin(float __x, float __y) 1303 { return __builtin_fminf(__x, __y); } 1304 1305 inline long double 1306 fmin(long double __x, long double __y) 1307 { return __builtin_fminl(__x, __y); } 1308 1309 template<typename _Tp, typename _Up> 1310 inline 1311 typename __gnu_cxx::__promote_2< 1312 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1313 && __is_arithmetic<_Up>::__value, 1314 _Tp>::__type, _Up>::__type 1315 fmin(_Tp __x, _Up __y) 1316 { 1317 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1318 return fmin(__type(__x), __type(__y)); 1319 } 1320 1321 inline float 1322 hypot(float __x, float __y) 1323 { return __builtin_hypotf(__x, __y); } 1324 1325 inline long double 1326 hypot(long double __x, long double __y) 1327 { return __builtin_hypotl(__x, __y); } 1328 1329 template<typename _Tp, typename _Up> 1330 inline 1331 typename __gnu_cxx::__promote_2< 1332 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1333 && __is_arithmetic<_Up>::__value, 1334 _Tp>::__type, _Up>::__type 1335 hypot(_Tp __x, _Up __y) 1336 { 1337 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1338 return hypot(__type(__x), __type(__y)); 1339 } 1340 1341 inline int 1342 ilogb(float __x) 1343 { return __builtin_ilogbf(__x); } 1344 1345 inline int 1346 ilogb(long double __x) 1347 { return __builtin_ilogbl(__x); } 1348 1349 template<typename _Tp> 1350 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1351 int>::__type 1352 ilogb(_Tp __x) 1353 { return __builtin_ilogb(__x); } 1354 1355 inline float 1356 lgamma(float __x) 1357 { return __builtin_lgammaf(__x); } 1358 1359 inline long double 1360 lgamma(long double __x) 1361 { return __builtin_lgammal(__x); } 1362 1363 template<typename _Tp> 1364 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1365 double>::__type 1366 lgamma(_Tp __x) 1367 { return __builtin_lgamma(__x); } 1368 1369 inline long long 1370 llrint(float __x) 1371 { return __builtin_llrintf(__x); } 1372 1373 inline long long 1374 llrint(long double __x) 1375 { return __builtin_llrintl(__x); } 1376 1377 template<typename _Tp> 1378 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1379 long long>::__type 1380 llrint(_Tp __x) 1381 { return __builtin_llrint(__x); } 1382 1383 inline long long 1384 llround(float __x) 1385 { return __builtin_llroundf(__x); } 1386 1387 inline long long 1388 llround(long double __x) 1389 { return __builtin_llroundl(__x); } 1390 1391 template<typename _Tp> 1392 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1393 long long>::__type 1394 llround(_Tp __x) 1395 { return __builtin_llround(__x); } 1396 1397 inline float 1398 log1p(float __x) 1399 { return __builtin_log1pf(__x); } 1400 1401 inline long double 1402 log1p(long double __x) 1403 { return __builtin_log1pl(__x); } 1404 1405 template<typename _Tp> 1406 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1407 double>::__type 1408 log1p(_Tp __x) 1409 { return __builtin_log1p(__x); } 1410 1411 // DR 568. 1412 inline float 1413 log2(float __x) 1414 { return __builtin_log2f(__x); } 1415 1416 inline long double 1417 log2(long double __x) 1418 { return __builtin_log2l(__x); } 1419 1420 template<typename _Tp> 1421 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1422 double>::__type 1423 log2(_Tp __x) 1424 { return __builtin_log2(__x); } 1425 1426 inline float 1427 logb(float __x) 1428 { return __builtin_logbf(__x); } 1429 1430 inline long double 1431 logb(long double __x) 1432 { return __builtin_logbl(__x); } 1433 1434 template<typename _Tp> 1435 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1436 double>::__type 1437 logb(_Tp __x) 1438 { return __builtin_logb(__x); } 1439 1440 inline long 1441 lrint(float __x) 1442 { return __builtin_lrintf(__x); } 1443 1444 inline long 1445 lrint(long double __x) 1446 { return __builtin_lrintl(__x); } 1447 1448 template<typename _Tp> 1449 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1450 long>::__type 1451 lrint(_Tp __x) 1452 { return __builtin_lrint(__x); } 1453 1454 inline long 1455 lround(float __x) 1456 { return __builtin_lroundf(__x); } 1457 1458 inline long 1459 lround(long double __x) 1460 { return __builtin_lroundl(__x); } 1461 1462 template<typename _Tp> 1463 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1464 long>::__type 1465 lround(_Tp __x) 1466 { return __builtin_lround(__x); } 1467 1468 inline float 1469 nearbyint(float __x) 1470 { return __builtin_nearbyintf(__x); } 1471 1472 inline long double 1473 nearbyint(long double __x) 1474 { return __builtin_nearbyintl(__x); } 1475 1476 template<typename _Tp> 1477 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1478 double>::__type 1479 nearbyint(_Tp __x) 1480 { return __builtin_nearbyint(__x); } 1481 1482 inline float 1483 nextafter(float __x, float __y) 1484 { return __builtin_nextafterf(__x, __y); } 1485 1486 inline long double 1487 nextafter(long double __x, long double __y) 1488 { return __builtin_nextafterl(__x, __y); } 1489 1490 template<typename _Tp, typename _Up> 1491 inline 1492 typename __gnu_cxx::__promote_2< 1493 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1494 && __is_arithmetic<_Up>::__value, 1495 _Tp>::__type, _Up>::__type 1496 nextafter(_Tp __x, _Up __y) 1497 { 1498 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1499 return nextafter(__type(__x), __type(__y)); 1500 } 1501 1502 inline float 1503 nexttoward(float __x, long double __y) 1504 { return __builtin_nexttowardf(__x, __y); } 1505 1506 inline long double 1507 nexttoward(long double __x, long double __y) 1508 { return __builtin_nexttowardl(__x, __y); } 1509 1510 template<typename _Tp> 1511 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1512 double>::__type 1513 nexttoward(_Tp __x, long double __y) 1514 { return __builtin_nexttoward(__x, __y); } 1515 1516 inline float 1517 remainder(float __x, float __y) 1518 { return __builtin_remainderf(__x, __y); } 1519 1520 inline long double 1521 remainder(long double __x, long double __y) 1522 { return __builtin_remainderl(__x, __y); } 1523 1524 template<typename _Tp, typename _Up> 1525 inline 1526 typename __gnu_cxx::__promote_2< 1527 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1528 && __is_arithmetic<_Up>::__value, 1529 _Tp>::__type, _Up>::__type 1530 remainder(_Tp __x, _Up __y) 1531 { 1532 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1533 return remainder(__type(__x), __type(__y)); 1534 } 1535 1536 inline float 1537 remquo(float __x, float __y, int* __pquo) 1538 { return __builtin_remquof(__x, __y, __pquo); } 1539 1540 inline long double 1541 remquo(long double __x, long double __y, int* __pquo) 1542 { return __builtin_remquol(__x, __y, __pquo); } 1543 1544 template<typename _Tp, typename _Up> 1545 inline 1546 typename __gnu_cxx::__promote_2< 1547 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value 1548 && __is_arithmetic<_Up>::__value, 1549 _Tp>::__type, _Up>::__type 1550 remquo(_Tp __x, _Up __y, int* __pquo) 1551 { 1552 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1553 return remquo(__type(__x), __type(__y), __pquo); 1554 } 1555 1556 inline float 1557 rint(float __x) 1558 { return __builtin_rintf(__x); } 1559 1560 inline long double 1561 rint(long double __x) 1562 { return __builtin_rintl(__x); } 1563 1564 template<typename _Tp> 1565 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1566 double>::__type 1567 rint(_Tp __x) 1568 { return __builtin_rint(__x); } 1569 1570 inline float 1571 round(float __x) 1572 { return __builtin_roundf(__x); } 1573 1574 inline long double 1575 round(long double __x) 1576 { return __builtin_roundl(__x); } 1577 1578 template<typename _Tp> 1579 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1580 double>::__type 1581 round(_Tp __x) 1582 { return __builtin_round(__x); } 1583 1584 inline float 1585 scalbln(float __x, long __ex) 1586 { return __builtin_scalblnf(__x, __ex); } 1587 1588 inline long double 1589 scalbln(long double __x, long __ex) 1590 { return __builtin_scalblnl(__x, __ex); } 1591 1592 template<typename _Tp> 1593 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1594 double>::__type 1595 scalbln(_Tp __x, long __ex) 1596 { return __builtin_scalbln(__x, __ex); } 1597 1598 inline float 1599 scalbn(float __x, int __ex) 1600 { return __builtin_scalbnf(__x, __ex); } 1601 1602 inline long double 1603 scalbn(long double __x, int __ex) 1604 { return __builtin_scalbnl(__x, __ex); } 1605 1606 template<typename _Tp> 1607 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1608 double>::__type 1609 scalbn(_Tp __x, int __ex) 1610 { return __builtin_scalbn(__x, __ex); } 1611 1612 inline float 1613 tgamma(float __x) 1614 { return __builtin_tgammaf(__x); } 1615 1616 inline long double 1617 tgamma(long double __x) 1618 { return __builtin_tgammal(__x); } 1619 1620 template<typename _Tp> 1621 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1622 double>::__type 1623 tgamma(_Tp __x) 1624 { return __builtin_tgamma(__x); } 1625 1626 inline float 1627 trunc(float __x) 1628 { return __builtin_truncf(__x); } 1629 1630 inline long double 1631 trunc(long double __x) 1632 { return __builtin_truncl(__x); } 1633 1634 template<typename _Tp> 1635 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1636 double>::__type 1637 trunc(_Tp __x) 1638 { return __builtin_trunc(__x); } 1639 1640 _GLIBCXX_END_NAMESPACE_VERSION 1641 } // namespace 1642 1643 #endif // _GLIBCXX_USE_C99_MATH_TR1 1644 1645 #endif // __GXX_EXPERIMENTAL_CXX0X__ 1646 1647 #endif 1648