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