tr1_impl/cmath

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

Generated on Thu Jul 23 21:16:02 2009 for libstdc++ by  doxygen 1.5.8