tr1_impl/cmath

Go to the documentation of this file.
00001 // TR1 cmath -*- C++ -*-
00002 
00003 // Copyright (C) 2007 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the
00008 // Free Software Foundation; either version 2, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 
00016 // You should have received a copy of the GNU General Public License along
00017 // with this library; see the file COPYING.  If not, write to the Free
00018 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00019 // USA.
00020 
00021 // As a special exception, you may use this file as part of a free software
00022 // library without restriction.  Specifically, if other files instantiate
00023 // templates or use macros or inline functions from this file, or you compile
00024 // this file and link it with other files to produce an executable, this
00025 // file does not by itself cause the resulting executable to be covered by
00026 // the GNU General Public License.  This exception does not however
00027 // invalidate any other reasons why the executable file might be covered by
00028 // the GNU General Public License.
00029 
00030 /** @file tr1_impl/cmath
00031  *  This is an internal header file, included by other library headers.
00032  *  You should not attempt to use it directly.
00033  */
00034 
00035 #if _GLIBCXX_USE_C99_MATH_TR1
00036 
00037 #undef acosh
00038 #undef acoshf
00039 #undef acoshl
00040 #undef asinh
00041 #undef asinhf
00042 #undef asinhl
00043 #undef atanh
00044 #undef atanhf
00045 #undef atanhl
00046 #undef cbrt
00047 #undef cbrtf
00048 #undef cbrtl
00049 #undef copysign
00050 #undef copysignf
00051 #undef copysignl
00052 #undef erf
00053 #undef erff
00054 #undef erfl
00055 #undef erfc
00056 #undef erfcf
00057 #undef erfcl
00058 #undef exp2
00059 #undef exp2f
00060 #undef exp2l
00061 #undef expm1
00062 #undef expm1f
00063 #undef expm1l
00064 #undef fdim
00065 #undef fdimf
00066 #undef fdiml
00067 #undef fma
00068 #undef fmaf
00069 #undef fmal
00070 #undef fmax
00071 #undef fmaxf
00072 #undef fmaxl
00073 #undef fmin
00074 #undef fminf
00075 #undef fminl
00076 #undef hypot
00077 #undef hypotf
00078 #undef hypotl
00079 #undef ilogb
00080 #undef ilogbf
00081 #undef ilogbl
00082 #undef lgamma
00083 #undef lgammaf
00084 #undef lgammal
00085 #undef llrint
00086 #undef llrintf
00087 #undef llrintl
00088 #undef llround
00089 #undef llroundf
00090 #undef llroundl
00091 #undef log1p
00092 #undef log1pf
00093 #undef log1pl
00094 #undef log2
00095 #undef log2f
00096 #undef log2l
00097 #undef logb
00098 #undef logbf
00099 #undef logbl
00100 #undef lrint
00101 #undef lrintf
00102 #undef lrintl
00103 #undef lround
00104 #undef lroundf
00105 #undef lroundl
00106 #undef nan
00107 #undef nanf
00108 #undef nanl
00109 #undef nearbyint
00110 #undef nearbyintf
00111 #undef nearbyintl
00112 #undef nextafter
00113 #undef nextafterf
00114 #undef nextafterl
00115 #undef nexttoward
00116 #undef nexttowardf
00117 #undef nexttowardl
00118 #undef remainder
00119 #undef remainderf
00120 #undef remainderl
00121 #undef remquo
00122 #undef remquo
00123 #undef remquo
00124 #undef rint
00125 #undef rintf
00126 #undef rintl
00127 #undef round
00128 #undef roundf
00129 #undef roundl
00130 #undef scalbln
00131 #undef scalblnf
00132 #undef scalblnl
00133 #undef scalbn
00134 #undef scalbnf
00135 #undef scalbnl
00136 #undef tgamma
00137 #undef tgammaf
00138 #undef tgammal
00139 #undef trunc
00140 #undef truncf
00141 #undef truncl
00142 
00143 #endif
00144 
00145 namespace std
00146 {
00147 _GLIBCXX_BEGIN_NAMESPACE_TR1
00148 
00149 #if _GLIBCXX_USE_C99_MATH_TR1
00150 
00151   // types
00152   using ::double_t;
00153   using ::float_t;
00154 
00155   // functions
00156   using ::acosh;
00157   using ::acoshf;
00158   using ::acoshl;
00159 
00160   using ::asinh;
00161   using ::asinhf;
00162   using ::asinhl;
00163 
00164   using ::atanh;
00165   using ::atanhf;
00166   using ::atanhl;
00167 
00168   using ::cbrt;
00169   using ::cbrtf;
00170   using ::cbrtl;
00171 
00172   using ::copysign;
00173   using ::copysignf;
00174   using ::copysignl;
00175 
00176   using ::erf;
00177   using ::erff;
00178   using ::erfl;
00179 
00180   using ::erfc;
00181   using ::erfcf;
00182   using ::erfcl;
00183 
00184   using ::exp2;
00185   using ::exp2f;
00186   using ::exp2l;
00187 
00188   using ::expm1;
00189   using ::expm1f;
00190   using ::expm1l;
00191 
00192   using ::fdim;
00193   using ::fdimf;
00194   using ::fdiml;
00195 
00196   using ::fma;
00197   using ::fmaf;
00198   using ::fmal;
00199 
00200   using ::fmax;
00201   using ::fmaxf;
00202   using ::fmaxl;
00203 
00204   using ::fmin;
00205   using ::fminf;
00206   using ::fminl;
00207 
00208   using ::hypot;
00209   using ::hypotf;
00210   using ::hypotl;
00211 
00212   using ::ilogb;
00213   using ::ilogbf;
00214   using ::ilogbl;
00215 
00216   using ::lgamma;
00217   using ::lgammaf;
00218   using ::lgammal;
00219 
00220   using ::llrint;
00221   using ::llrintf;
00222   using ::llrintl;
00223 
00224   using ::llround;
00225   using ::llroundf;
00226   using ::llroundl;
00227 
00228   using ::log1p;
00229   using ::log1pf;
00230   using ::log1pl;
00231 
00232   using ::log2;
00233   using ::log2f;
00234   using ::log2l;
00235 
00236   using ::logb;
00237   using ::logbf;
00238   using ::logbl;
00239 
00240   using ::lrint;
00241   using ::lrintf;
00242   using ::lrintl;
00243 
00244   using ::lround;
00245   using ::lroundf;
00246   using ::lroundl;
00247 
00248   using ::nan;
00249   using ::nanf;
00250   using ::nanl;
00251 
00252   using ::nearbyint;
00253   using ::nearbyintf;
00254   using ::nearbyintl;
00255 
00256   using ::nextafter;
00257   using ::nextafterf;
00258   using ::nextafterl;
00259 
00260   using ::nexttoward;
00261   using ::nexttowardf;
00262   using ::nexttowardl;
00263 
00264   using ::remainder;
00265   using ::remainderf;
00266   using ::remainderl;
00267 
00268   using ::remquo;
00269   using ::remquo;
00270   using ::remquo;
00271 
00272   using ::rint;
00273   using ::rintf;
00274   using ::rintl;
00275 
00276   using ::round;
00277   using ::roundf;
00278   using ::roundl;
00279 
00280   using ::scalbln;
00281   using ::scalblnf;
00282   using ::scalblnl;
00283 
00284   using ::scalbn;
00285   using ::scalbnf;
00286   using ::scalbnl;
00287 
00288   using ::tgamma;
00289   using ::tgammaf;
00290   using ::tgammal;
00291 
00292   using ::trunc;
00293   using ::truncf;
00294   using ::truncl;
00295 
00296 #endif
00297 
00298 #if _GLIBCXX_USE_C99_MATH
00299 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
00300 
00301   /// Function template definitions [8.16.3].
00302   using std::signbit;
00303   
00304   using std::fpclassify;
00305 
00306   using std::isfinite;
00307   using std::isinf;
00308   using std::isnan;
00309   using std::isnormal;
00310 
00311   using std::isgreater;
00312   using std::isgreaterequal;
00313   using std::isless;
00314   using std::islessequal;
00315   using std::islessgreater;
00316   using std::isunordered;
00317 #endif
00318 #endif
00319 
00320 #if _GLIBCXX_USE_C99_MATH_TR1
00321 
00322   /// Additional overloads [8.16.4].
00323   using std::acos;
00324 
00325   inline float
00326   acosh(float __x)
00327   { return __builtin_acoshf(__x); }
00328 
00329   inline long double
00330   acosh(long double __x)
00331   { return __builtin_acoshl(__x); }
00332 
00333   template<typename _Tp>
00334     inline typename __gnu_cxx::__promote<_Tp>::__type 
00335     acosh(_Tp __x)
00336     {
00337       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00338       return acosh(__type(__x));
00339     }
00340 
00341   using std::asin;
00342 
00343   inline float
00344   asinh(float __x)
00345   { return __builtin_asinhf(__x); }
00346 
00347   inline long double
00348   asinh(long double __x)
00349   { return __builtin_asinhl(__x); }
00350 
00351   template<typename _Tp>
00352     inline typename __gnu_cxx::__promote<_Tp>::__type 
00353     asinh(_Tp __x)
00354     {
00355       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00356       return asinh(__type(__x));
00357     }
00358 
00359   using std::atan;
00360   using std::atan2;
00361 
00362   inline float
00363   atanh(float __x)
00364   { return __builtin_atanhf(__x); }
00365 
00366   inline long double
00367   atanh(long double __x)
00368   { return __builtin_atanhl(__x); }
00369 
00370   template<typename _Tp>
00371     inline typename __gnu_cxx::__promote<_Tp>::__type 
00372     atanh(_Tp __x)
00373     {
00374       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00375       return atanh(__type(__x));
00376     }
00377 
00378   inline float
00379   cbrt(float __x)
00380   { return __builtin_cbrtf(__x); }
00381 
00382   inline long double
00383   cbrt(long double __x)
00384   { return __builtin_cbrtl(__x); }
00385 
00386   template<typename _Tp>
00387     inline typename __gnu_cxx::__promote<_Tp>::__type 
00388     cbrt(_Tp __x)
00389     {
00390       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00391       return cbrt(__type(__x));
00392     }
00393 
00394   using std::ceil;
00395 
00396   inline float
00397   copysign(float __x, float __y)
00398   { return __builtin_copysignf(__x, __y); }
00399 
00400   inline long double
00401   copysign(long double __x, long double __y)
00402   { return __builtin_copysignl(__x, __y); }
00403 
00404   template<typename _Tp, typename _Up>
00405     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00406     copysign(_Tp __x, _Up __y)
00407     {
00408       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00409       return copysign(__type(__x), __type(__y));
00410     }
00411 
00412   using std::cos;
00413   using std::cosh;  
00414 
00415   inline float
00416   erf(float __x)
00417   { return __builtin_erff(__x); }
00418 
00419   inline long double
00420   erf(long double __x)
00421   { return __builtin_erfl(__x); }
00422 
00423   template<typename _Tp>
00424     inline typename __gnu_cxx::__promote<_Tp>::__type 
00425     erf(_Tp __x)
00426     {
00427       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00428       return erf(__type(__x));
00429     }
00430 
00431   inline float
00432   erfc(float __x)
00433   { return __builtin_erfcf(__x); }
00434 
00435   inline long double
00436   erfc(long double __x)
00437   { return __builtin_erfcl(__x); }
00438 
00439   template<typename _Tp>
00440     inline typename __gnu_cxx::__promote<_Tp>::__type 
00441     erfc(_Tp __x)
00442     {
00443       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00444       return erfc(__type(__x));
00445     }
00446 
00447   using std::exp;
00448 
00449   inline float
00450   exp2(float __x)
00451   { return __builtin_exp2f(__x); }
00452 
00453   inline long double
00454   exp2(long double __x)
00455   { return __builtin_exp2l(__x); }
00456 
00457   template<typename _Tp>
00458     inline typename __gnu_cxx::__promote<_Tp>::__type 
00459     exp2(_Tp __x)
00460     {
00461       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00462       return exp2(__type(__x));
00463     }
00464 
00465   inline float
00466   expm1(float __x)
00467   { return __builtin_expm1f(__x); }
00468 
00469   inline long double
00470   expm1(long double __x)
00471   { return __builtin_expm1l(__x); }
00472 
00473   template<typename _Tp>
00474     inline typename __gnu_cxx::__promote<_Tp>::__type 
00475     expm1(_Tp __x)
00476     {
00477       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00478       return expm1(__type(__x));
00479     }
00480 
00481   using std::fabs;
00482 
00483   inline float
00484   fdim(float __x, float __y)
00485   { return __builtin_fdimf(__x, __y); }
00486 
00487   inline long double
00488   fdim(long double __x, long double __y)
00489   { return __builtin_fdiml(__x, __y); }
00490 
00491   template<typename _Tp, typename _Up>
00492     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00493     fdim(_Tp __x, _Up __y)
00494     {
00495       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00496       return fdim(__type(__x), __type(__y));
00497     }
00498 
00499   using std::floor;
00500 
00501   inline float
00502   fma(float __x, float __y, float __z)
00503   { return __builtin_fmaf(__x, __y, __z); }
00504 
00505   inline long double
00506   fma(long double __x, long double __y, long double __z)
00507   { return __builtin_fmal(__x, __y, __z); }
00508 
00509   template<typename _Tp, typename _Up, typename _Vp>
00510     inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
00511     fma(_Tp __x, _Up __y, _Vp __z)
00512     {
00513       typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
00514       return fma(__type(__x), __type(__y), __type(__z));
00515     }
00516 
00517   inline float
00518   fmax(float __x, float __y)
00519   { return __builtin_fmaxf(__x, __y); }
00520 
00521   inline long double
00522   fmax(long double __x, long double __y)
00523   { return __builtin_fmaxl(__x, __y); }
00524 
00525   template<typename _Tp, typename _Up>
00526     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00527     fmax(_Tp __x, _Up __y)
00528     {
00529       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00530       return fmax(__type(__x), __type(__y));
00531     }
00532 
00533   inline float
00534   fmin(float __x, float __y)
00535   { return __builtin_fminf(__x, __y); }
00536 
00537   inline long double
00538   fmin(long double __x, long double __y)
00539   { return __builtin_fminl(__x, __y); }
00540 
00541   template<typename _Tp, typename _Up>
00542     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00543     fmin(_Tp __x, _Up __y)
00544     {
00545       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00546       return fmin(__type(__x), __type(__y));
00547     }
00548 
00549   using std::fmod;
00550   using std::frexp;
00551 
00552   inline float
00553   hypot(float __x, float __y)
00554   { return __builtin_hypotf(__x, __y); }
00555 
00556   inline long double
00557   hypot(long double __x, long double __y)
00558   { return __builtin_hypotl(__x, __y); }
00559 
00560   template<typename _Tp, typename _Up>
00561     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00562     hypot(_Tp __x, _Up __y)
00563     {
00564       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00565       return hypot(__type(__x), __type(__y));
00566     }
00567 
00568   inline int
00569   ilogb(float __x)
00570   { return __builtin_ilogbf(__x); }
00571 
00572   inline int
00573   ilogb(long double __x)
00574   { return __builtin_ilogbl(__x); }
00575 
00576   template<typename _Tp>
00577     inline int
00578     ilogb(_Tp __x)
00579     {
00580       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00581       return ilogb(__type(__x));
00582     }
00583 
00584   using std::ldexp;
00585 
00586   inline float
00587   lgamma(float __x)
00588   { return __builtin_lgammaf(__x); }
00589 
00590   inline long double
00591   lgamma(long double __x)
00592   { return __builtin_lgammal(__x); }
00593 
00594   template<typename _Tp>
00595     inline typename __gnu_cxx::__promote<_Tp>::__type 
00596     lgamma(_Tp __x)
00597     {
00598       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00599       return lgamma(__type(__x));
00600     }
00601 
00602   inline long long
00603   llrint(float __x)
00604   { return __builtin_llrintf(__x); }
00605 
00606   inline long long
00607   llrint(long double __x)
00608   { return __builtin_llrintl(__x); }
00609 
00610   template<typename _Tp>
00611     inline long long
00612     llrint(_Tp __x)
00613     {
00614       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00615       return llrint(__type(__x));
00616     }
00617 
00618   inline long long
00619   llround(float __x)
00620   { return __builtin_llroundf(__x); }
00621 
00622   inline long long
00623   llround(long double __x)
00624   { return __builtin_llroundl(__x); }
00625 
00626   template<typename _Tp>
00627     inline long long
00628     llround(_Tp __x)
00629     {
00630       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00631       return llround(__type(__x));
00632     }
00633 
00634   using std::log;
00635   using std::log10;
00636 
00637   inline float
00638   log1p(float __x)
00639   { return __builtin_log1pf(__x); }
00640 
00641   inline long double
00642   log1p(long double __x)
00643   { return __builtin_log1pl(__x); }
00644 
00645   template<typename _Tp>
00646     inline typename __gnu_cxx::__promote<_Tp>::__type 
00647     log1p(_Tp __x)
00648     {
00649       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00650       return log1p(__type(__x));
00651     }
00652 
00653   // DR 568.
00654   inline float
00655   log2(float __x)
00656   { return __builtin_log2f(__x); }
00657 
00658   inline long double
00659   log2(long double __x)
00660   { return __builtin_log2l(__x); }
00661 
00662   template<typename _Tp>
00663     inline typename __gnu_cxx::__promote<_Tp>::__type 
00664     log2(_Tp __x)
00665     {
00666       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00667       return log2(__type(__x));
00668     }
00669 
00670   inline float
00671   logb(float __x)
00672   { return __builtin_logbf(__x); }
00673 
00674   inline long double
00675   logb(long double __x)
00676   { return __builtin_logbl(__x); }
00677 
00678   template<typename _Tp>
00679     inline typename __gnu_cxx::__promote<_Tp>::__type 
00680     logb(_Tp __x)
00681     {
00682       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00683       return logb(__type(__x));
00684     }
00685 
00686   inline long
00687   lrint(float __x)
00688   { return __builtin_lrintf(__x); }
00689 
00690   inline long
00691   lrint(long double __x)
00692   { return __builtin_lrintl(__x); }
00693 
00694   template<typename _Tp>
00695     inline long
00696     lrint(_Tp __x)
00697     {
00698       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00699       return lrint(__type(__x));
00700     }
00701 
00702   inline long
00703   lround(float __x)
00704   { return __builtin_lroundf(__x); }
00705 
00706   inline long
00707   lround(long double __x)
00708   { return __builtin_lroundl(__x); }
00709 
00710   template<typename _Tp>
00711     inline long
00712     lround(_Tp __x)
00713     {
00714       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00715       return lround(__type(__x));
00716     }
00717 
00718   inline float
00719   nearbyint(float __x)
00720   { return __builtin_nearbyintf(__x); }
00721 
00722   inline long double
00723   nearbyint(long double __x)
00724   { return __builtin_nearbyintl(__x); }
00725 
00726   template<typename _Tp>
00727     inline typename __gnu_cxx::__promote<_Tp>::__type 
00728     nearbyint(_Tp __x)
00729     {
00730       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00731       return nearbyint(__type(__x));
00732     }
00733 
00734   inline float
00735   nextafter(float __x, float __y)
00736   { return __builtin_nextafterf(__x, __y); }
00737 
00738   inline long double
00739   nextafter(long double __x, long double __y)
00740   { return __builtin_nextafterl(__x, __y); }
00741 
00742   template<typename _Tp, typename _Up>
00743     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00744     nextafter(_Tp __x, _Up __y)
00745     {
00746       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00747       return nextafter(__type(__x), __type(__y));
00748     }
00749 
00750   inline float
00751   nexttoward(float __x, long double __y)
00752   { return __builtin_nexttowardf(__x, __y); }
00753 
00754   inline long double
00755   nexttoward(long double __x, long double __y)
00756   { return __builtin_nexttowardl(__x, __y); }
00757 
00758   template<typename _Tp>
00759     inline typename __gnu_cxx::__promote<_Tp>::__type
00760     nexttoward(_Tp __x, long double __y)
00761     {
00762       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00763       return nexttoward(__type(__x), __y);
00764     }
00765 
00766   using std::pow;
00767 
00768   inline float
00769   remainder(float __x, float __y)
00770   { return __builtin_remainderf(__x, __y); }
00771 
00772   inline long double
00773   remainder(long double __x, long double __y)
00774   { return __builtin_remainderl(__x, __y); }
00775 
00776   template<typename _Tp, typename _Up>
00777     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00778     remainder(_Tp __x, _Up __y)
00779     {
00780       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00781       return remainder(__type(__x), __type(__y));
00782     }
00783 
00784   inline float
00785   remquo(float __x, float __y, int* __pquo)
00786   { return __builtin_remquof(__x, __y, __pquo); }
00787 
00788   inline long double
00789   remquo(long double __x, long double __y, int* __pquo)
00790   { return __builtin_remquol(__x, __y, __pquo); }
00791 
00792   template<typename _Tp, typename _Up>
00793     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00794     remquo(_Tp __x, _Up __y, int* __pquo)
00795     {
00796       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00797       return remquo(__type(__x), __type(__y), __pquo);
00798     }
00799 
00800   inline float
00801   rint(float __x)
00802   { return __builtin_rintf(__x); }
00803 
00804   inline long double
00805   rint(long double __x)
00806   { return __builtin_rintl(__x); }
00807 
00808   template<typename _Tp>
00809     inline typename __gnu_cxx::__promote<_Tp>::__type
00810     rint(_Tp __x)
00811     {
00812       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00813       return rint(__type(__x));
00814     }
00815 
00816   inline float
00817   round(float __x)
00818   { return __builtin_roundf(__x); }
00819 
00820   inline long double
00821   round(long double __x)
00822   { return __builtin_roundl(__x); }
00823 
00824   template<typename _Tp>
00825     inline typename __gnu_cxx::__promote<_Tp>::__type
00826     round(_Tp __x)
00827     {
00828       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00829       return round(__type(__x));
00830     }
00831 
00832   inline float
00833   scalbln(float __x, long __ex)
00834   { return __builtin_scalblnf(__x, __ex); }
00835 
00836   inline long double
00837   scalbln(long double __x, long __ex)
00838   { return __builtin_scalblnl(__x, __ex); }
00839 
00840   template<typename _Tp>
00841     inline typename __gnu_cxx::__promote<_Tp>::__type 
00842     scalbln(_Tp __x, long __ex)
00843     {
00844       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00845       return scalbln(__type(__x), __ex);
00846     }
00847  
00848   inline float
00849   scalbn(float __x, int __ex)
00850   { return __builtin_scalbnf(__x, __ex); }
00851 
00852   inline long double
00853   scalbn(long double __x, int __ex)
00854   { return __builtin_scalbnl(__x, __ex); }
00855 
00856   template<typename _Tp>
00857     inline typename __gnu_cxx::__promote<_Tp>::__type 
00858     scalbn(_Tp __x, int __ex)
00859     {
00860       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00861       return scalbn(__type(__x), __ex);
00862     }
00863 
00864   using std::sin;
00865   using std::sinh;
00866   using std::sqrt;
00867   using std::tan;
00868   using std::tanh;
00869 
00870   inline float
00871   tgamma(float __x)
00872   { return __builtin_tgammaf(__x); }
00873 
00874   inline long double
00875   tgamma(long double __x)
00876   { return __builtin_tgammal(__x); }
00877 
00878   template<typename _Tp>
00879     inline typename __gnu_cxx::__promote<_Tp>::__type 
00880     tgamma(_Tp __x)
00881     {
00882       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00883       return tgamma(__type(__x));
00884     }
00885  
00886   inline float
00887   trunc(float __x)
00888   { return __builtin_truncf(__x); }
00889 
00890   inline long double
00891   trunc(long double __x)
00892   { return __builtin_truncl(__x); }
00893 
00894   template<typename _Tp>
00895     inline typename __gnu_cxx::__promote<_Tp>::__type 
00896     trunc(_Tp __x)
00897     {
00898       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00899       return trunc(__type(__x));
00900     }
00901 
00902 #endif
00903 
00904 _GLIBCXX_END_NAMESPACE_TR1
00905 }

Generated on Fri Jan 23 20:12:10 2009 for libstdc++ by  doxygen 1.5.6