]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libstdc++-v3/contrib/libstdc++-v3-4.3.3/include/tr1_impl/cmath
update
[l4.git] / l4 / pkg / libstdc++-v3 / contrib / libstdc++-v3-4.3.3 / include / tr1_impl / cmath
1 // TR1 cmath -*- C++ -*-
2
3 // Copyright (C) 2007 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library.  This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING.  If not, write to the Free
18 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 // USA.
20
21 // As a special exception, you may use this file as part of a free software
22 // library without restriction.  Specifically, if other files instantiate
23 // templates or use macros or inline functions from this file, or you compile
24 // this file and link it with other files to produce an executable, this
25 // file does not by itself cause the resulting executable to be covered by
26 // the GNU General Public License.  This exception does not however
27 // invalidate any other reasons why the executable file might be covered by
28 // the GNU General Public License.
29
30 /** @file tr1_impl/cmath
31  *  This is an internal header file, included by other library headers.
32  *  You should not attempt to use it directly.
33  */
34
35 #if _GLIBCXX_USE_C99_MATH_TR1
36
37 #undef acosh
38 #undef acoshf
39 #undef acoshl
40 #undef asinh
41 #undef asinhf
42 #undef asinhl
43 #undef atanh
44 #undef atanhf
45 #undef atanhl
46 #undef cbrt
47 #undef cbrtf
48 #undef cbrtl
49 #undef copysign
50 #undef copysignf
51 #undef copysignl
52 #undef erf
53 #undef erff
54 #undef erfl
55 #undef erfc
56 #undef erfcf
57 #undef erfcl
58 #undef exp2
59 #undef exp2f
60 #undef exp2l
61 #undef expm1
62 #undef expm1f
63 #undef expm1l
64 #undef fdim
65 #undef fdimf
66 #undef fdiml
67 #undef fma
68 #undef fmaf
69 #undef fmal
70 #undef fmax
71 #undef fmaxf
72 #undef fmaxl
73 #undef fmin
74 #undef fminf
75 #undef fminl
76 #undef hypot
77 #undef hypotf
78 #undef hypotl
79 #undef ilogb
80 #undef ilogbf
81 #undef ilogbl
82 #undef lgamma
83 #undef lgammaf
84 #undef lgammal
85 #undef llrint
86 #undef llrintf
87 #undef llrintl
88 #undef llround
89 #undef llroundf
90 #undef llroundl
91 #undef log1p
92 #undef log1pf
93 #undef log1pl
94 #undef log2
95 #undef log2f
96 #undef log2l
97 #undef logb
98 #undef logbf
99 #undef logbl
100 #undef lrint
101 #undef lrintf
102 #undef lrintl
103 #undef lround
104 #undef lroundf
105 #undef lroundl
106 #undef nan
107 #undef nanf
108 #undef nanl
109 #undef nearbyint
110 #undef nearbyintf
111 #undef nearbyintl
112 #undef nextafter
113 #undef nextafterf
114 #undef nextafterl
115 #undef nexttoward
116 #undef nexttowardf
117 #undef nexttowardl
118 #undef remainder
119 #undef remainderf
120 #undef remainderl
121 #undef remquo
122 #undef remquo
123 #undef remquo
124 #undef rint
125 #undef rintf
126 #undef rintl
127 #undef round
128 #undef roundf
129 #undef roundl
130 #undef scalbln
131 #undef scalblnf
132 #undef scalblnl
133 #undef scalbn
134 #undef scalbnf
135 #undef scalbnl
136 #undef tgamma
137 #undef tgammaf
138 #undef tgammal
139 #undef trunc
140 #undef truncf
141 #undef truncl
142
143 #endif
144
145 namespace std
146 {
147 _GLIBCXX_BEGIN_NAMESPACE_TR1
148
149 #if _GLIBCXX_USE_C99_MATH_TR1
150
151   // types
152   using ::double_t;
153   using ::float_t;
154
155   // functions
156   using ::acosh;
157   using ::acoshf;
158   using ::acoshl;
159
160   using ::asinh;
161   using ::asinhf;
162   using ::asinhl;
163
164   using ::atanh;
165   using ::atanhf;
166   using ::atanhl;
167
168   using ::cbrt;
169   using ::cbrtf;
170   using ::cbrtl;
171
172   using ::copysign;
173   using ::copysignf;
174   using ::copysignl;
175
176   using ::erf;
177   using ::erff;
178   using ::erfl;
179
180   using ::erfc;
181   using ::erfcf;
182   using ::erfcl;
183
184   using ::exp2;
185   using ::exp2f;
186   using ::exp2l;
187
188   using ::expm1;
189   using ::expm1f;
190   using ::expm1l;
191
192   using ::fdim;
193   using ::fdimf;
194   using ::fdiml;
195
196   using ::fma;
197   using ::fmaf;
198   using ::fmal;
199
200   using ::fmax;
201   using ::fmaxf;
202   using ::fmaxl;
203
204   using ::fmin;
205   using ::fminf;
206   using ::fminl;
207
208   using ::hypot;
209   using ::hypotf;
210   using ::hypotl;
211
212   using ::ilogb;
213   using ::ilogbf;
214   using ::ilogbl;
215
216   using ::lgamma;
217   using ::lgammaf;
218   using ::lgammal;
219
220   using ::llrint;
221   using ::llrintf;
222   using ::llrintl;
223
224   using ::llround;
225   using ::llroundf;
226   using ::llroundl;
227
228   using ::log1p;
229   using ::log1pf;
230   using ::log1pl;
231
232   using ::log2;
233   using ::log2f;
234   using ::log2l;
235
236   using ::logb;
237   using ::logbf;
238   using ::logbl;
239
240   using ::lrint;
241   using ::lrintf;
242   using ::lrintl;
243
244   using ::lround;
245   using ::lroundf;
246   using ::lroundl;
247
248   using ::nan;
249   using ::nanf;
250   using ::nanl;
251
252   using ::nearbyint;
253   using ::nearbyintf;
254   using ::nearbyintl;
255
256   using ::nextafter;
257   using ::nextafterf;
258   using ::nextafterl;
259
260   using ::nexttoward;
261   using ::nexttowardf;
262   using ::nexttowardl;
263
264   using ::remainder;
265   using ::remainderf;
266   using ::remainderl;
267
268   using ::remquo;
269   using ::remquo;
270   using ::remquo;
271
272   using ::rint;
273   using ::rintf;
274   using ::rintl;
275
276   using ::round;
277   using ::roundf;
278   using ::roundl;
279
280   using ::scalbln;
281   using ::scalblnf;
282   using ::scalblnl;
283
284   using ::scalbn;
285   using ::scalbnf;
286   using ::scalbnl;
287
288   using ::tgamma;
289   using ::tgammaf;
290   using ::tgammal;
291
292   using ::trunc;
293   using ::truncf;
294   using ::truncl;
295
296 #endif
297
298 #if _GLIBCXX_USE_C99_MATH
299 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
300
301   /// Function template definitions [8.16.3].
302   using std::signbit;
303   
304   using std::fpclassify;
305
306   using std::isfinite;
307   using std::isinf;
308   using std::isnan;
309   using std::isnormal;
310
311   using std::isgreater;
312   using std::isgreaterequal;
313   using std::isless;
314   using std::islessequal;
315   using std::islessgreater;
316   using std::isunordered;
317 #endif
318 #endif
319
320 #if _GLIBCXX_USE_C99_MATH_TR1
321
322   /// Additional overloads [8.16.4].
323   using std::acos;
324
325   inline float
326   acosh(float __x)
327   { return __builtin_acoshf(__x); }
328
329   inline long double
330   acosh(long double __x)
331   { return __builtin_acoshl(__x); }
332
333   template<typename _Tp>
334     inline typename __gnu_cxx::__promote<_Tp>::__type 
335     acosh(_Tp __x)
336     {
337       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
338       return acosh(__type(__x));
339     }
340
341   using std::asin;
342
343   inline float
344   asinh(float __x)
345   { return __builtin_asinhf(__x); }
346
347   inline long double
348   asinh(long double __x)
349   { return __builtin_asinhl(__x); }
350
351   template<typename _Tp>
352     inline typename __gnu_cxx::__promote<_Tp>::__type 
353     asinh(_Tp __x)
354     {
355       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
356       return asinh(__type(__x));
357     }
358
359   using std::atan;
360   using std::atan2;
361
362   inline float
363   atanh(float __x)
364   { return __builtin_atanhf(__x); }
365
366   inline long double
367   atanh(long double __x)
368   { return __builtin_atanhl(__x); }
369
370   template<typename _Tp>
371     inline typename __gnu_cxx::__promote<_Tp>::__type 
372     atanh(_Tp __x)
373     {
374       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
375       return atanh(__type(__x));
376     }
377
378   inline float
379   cbrt(float __x)
380   { return __builtin_cbrtf(__x); }
381
382   inline long double
383   cbrt(long double __x)
384   { return __builtin_cbrtl(__x); }
385
386   template<typename _Tp>
387     inline typename __gnu_cxx::__promote<_Tp>::__type 
388     cbrt(_Tp __x)
389     {
390       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
391       return cbrt(__type(__x));
392     }
393
394   using std::ceil;
395
396   inline float
397   copysign(float __x, float __y)
398   { return __builtin_copysignf(__x, __y); }
399
400   inline long double
401   copysign(long double __x, long double __y)
402   { return __builtin_copysignl(__x, __y); }
403
404   template<typename _Tp, typename _Up>
405     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
406     copysign(_Tp __x, _Up __y)
407     {
408       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
409       return copysign(__type(__x), __type(__y));
410     }
411
412   using std::cos;
413   using std::cosh;  
414
415   inline float
416   erf(float __x)
417   { return __builtin_erff(__x); }
418
419   inline long double
420   erf(long double __x)
421   { return __builtin_erfl(__x); }
422
423   template<typename _Tp>
424     inline typename __gnu_cxx::__promote<_Tp>::__type 
425     erf(_Tp __x)
426     {
427       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
428       return erf(__type(__x));
429     }
430
431   inline float
432   erfc(float __x)
433   { return __builtin_erfcf(__x); }
434
435   inline long double
436   erfc(long double __x)
437   { return __builtin_erfcl(__x); }
438
439   template<typename _Tp>
440     inline typename __gnu_cxx::__promote<_Tp>::__type 
441     erfc(_Tp __x)
442     {
443       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
444       return erfc(__type(__x));
445     }
446
447   using std::exp;
448
449   inline float
450   exp2(float __x)
451   { return __builtin_exp2f(__x); }
452
453   inline long double
454   exp2(long double __x)
455   { return __builtin_exp2l(__x); }
456
457   template<typename _Tp>
458     inline typename __gnu_cxx::__promote<_Tp>::__type 
459     exp2(_Tp __x)
460     {
461       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
462       return exp2(__type(__x));
463     }
464
465   inline float
466   expm1(float __x)
467   { return __builtin_expm1f(__x); }
468
469   inline long double
470   expm1(long double __x)
471   { return __builtin_expm1l(__x); }
472
473   template<typename _Tp>
474     inline typename __gnu_cxx::__promote<_Tp>::__type 
475     expm1(_Tp __x)
476     {
477       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
478       return expm1(__type(__x));
479     }
480
481   using std::fabs;
482
483   inline float
484   fdim(float __x, float __y)
485   { return __builtin_fdimf(__x, __y); }
486
487   inline long double
488   fdim(long double __x, long double __y)
489   { return __builtin_fdiml(__x, __y); }
490
491   template<typename _Tp, typename _Up>
492     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
493     fdim(_Tp __x, _Up __y)
494     {
495       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
496       return fdim(__type(__x), __type(__y));
497     }
498
499   using std::floor;
500
501   inline float
502   fma(float __x, float __y, float __z)
503   { return __builtin_fmaf(__x, __y, __z); }
504
505   inline long double
506   fma(long double __x, long double __y, long double __z)
507   { return __builtin_fmal(__x, __y, __z); }
508
509   template<typename _Tp, typename _Up, typename _Vp>
510     inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
511     fma(_Tp __x, _Up __y, _Vp __z)
512     {
513       typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
514       return fma(__type(__x), __type(__y), __type(__z));
515     }
516
517   inline float
518   fmax(float __x, float __y)
519   { return __builtin_fmaxf(__x, __y); }
520
521   inline long double
522   fmax(long double __x, long double __y)
523   { return __builtin_fmaxl(__x, __y); }
524
525   template<typename _Tp, typename _Up>
526     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
527     fmax(_Tp __x, _Up __y)
528     {
529       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
530       return fmax(__type(__x), __type(__y));
531     }
532
533   inline float
534   fmin(float __x, float __y)
535   { return __builtin_fminf(__x, __y); }
536
537   inline long double
538   fmin(long double __x, long double __y)
539   { return __builtin_fminl(__x, __y); }
540
541   template<typename _Tp, typename _Up>
542     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
543     fmin(_Tp __x, _Up __y)
544     {
545       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
546       return fmin(__type(__x), __type(__y));
547     }
548
549   using std::fmod;
550   using std::frexp;
551
552   inline float
553   hypot(float __x, float __y)
554   { return __builtin_hypotf(__x, __y); }
555
556   inline long double
557   hypot(long double __x, long double __y)
558   { return __builtin_hypotl(__x, __y); }
559
560   template<typename _Tp, typename _Up>
561     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
562     hypot(_Tp __x, _Up __y)
563     {
564       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
565       return hypot(__type(__x), __type(__y));
566     }
567
568   inline int
569   ilogb(float __x)
570   { return __builtin_ilogbf(__x); }
571
572   inline int
573   ilogb(long double __x)
574   { return __builtin_ilogbl(__x); }
575
576   template<typename _Tp>
577     inline int
578     ilogb(_Tp __x)
579     {
580       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
581       return ilogb(__type(__x));
582     }
583
584   using std::ldexp;
585
586   inline float
587   lgamma(float __x)
588   { return __builtin_lgammaf(__x); }
589
590   inline long double
591   lgamma(long double __x)
592   { return __builtin_lgammal(__x); }
593
594   template<typename _Tp>
595     inline typename __gnu_cxx::__promote<_Tp>::__type 
596     lgamma(_Tp __x)
597     {
598       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
599       return lgamma(__type(__x));
600     }
601
602   inline long long
603   llrint(float __x)
604   { return __builtin_llrintf(__x); }
605
606   inline long long
607   llrint(long double __x)
608   { return __builtin_llrintl(__x); }
609
610   template<typename _Tp>
611     inline long long
612     llrint(_Tp __x)
613     {
614       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
615       return llrint(__type(__x));
616     }
617
618   inline long long
619   llround(float __x)
620   { return __builtin_llroundf(__x); }
621
622   inline long long
623   llround(long double __x)
624   { return __builtin_llroundl(__x); }
625
626   template<typename _Tp>
627     inline long long
628     llround(_Tp __x)
629     {
630       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
631       return llround(__type(__x));
632     }
633
634   using std::log;
635   using std::log10;
636
637   inline float
638   log1p(float __x)
639   { return __builtin_log1pf(__x); }
640
641   inline long double
642   log1p(long double __x)
643   { return __builtin_log1pl(__x); }
644
645   template<typename _Tp>
646     inline typename __gnu_cxx::__promote<_Tp>::__type 
647     log1p(_Tp __x)
648     {
649       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
650       return log1p(__type(__x));
651     }
652
653   // DR 568.
654   inline float
655   log2(float __x)
656   { return __builtin_log2f(__x); }
657
658   inline long double
659   log2(long double __x)
660   { return __builtin_log2l(__x); }
661
662   template<typename _Tp>
663     inline typename __gnu_cxx::__promote<_Tp>::__type 
664     log2(_Tp __x)
665     {
666       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
667       return log2(__type(__x));
668     }
669
670   inline float
671   logb(float __x)
672   { return __builtin_logbf(__x); }
673
674   inline long double
675   logb(long double __x)
676   { return __builtin_logbl(__x); }
677
678   template<typename _Tp>
679     inline typename __gnu_cxx::__promote<_Tp>::__type 
680     logb(_Tp __x)
681     {
682       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
683       return logb(__type(__x));
684     }
685
686   inline long
687   lrint(float __x)
688   { return __builtin_lrintf(__x); }
689
690   inline long
691   lrint(long double __x)
692   { return __builtin_lrintl(__x); }
693
694   template<typename _Tp>
695     inline long
696     lrint(_Tp __x)
697     {
698       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
699       return lrint(__type(__x));
700     }
701
702   inline long
703   lround(float __x)
704   { return __builtin_lroundf(__x); }
705
706   inline long
707   lround(long double __x)
708   { return __builtin_lroundl(__x); }
709
710   template<typename _Tp>
711     inline long
712     lround(_Tp __x)
713     {
714       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
715       return lround(__type(__x));
716     }
717
718   inline float
719   nearbyint(float __x)
720   { return __builtin_nearbyintf(__x); }
721
722   inline long double
723   nearbyint(long double __x)
724   { return __builtin_nearbyintl(__x); }
725
726   template<typename _Tp>
727     inline typename __gnu_cxx::__promote<_Tp>::__type 
728     nearbyint(_Tp __x)
729     {
730       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
731       return nearbyint(__type(__x));
732     }
733
734   inline float
735   nextafter(float __x, float __y)
736   { return __builtin_nextafterf(__x, __y); }
737
738   inline long double
739   nextafter(long double __x, long double __y)
740   { return __builtin_nextafterl(__x, __y); }
741
742   template<typename _Tp, typename _Up>
743     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
744     nextafter(_Tp __x, _Up __y)
745     {
746       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
747       return nextafter(__type(__x), __type(__y));
748     }
749
750   inline float
751   nexttoward(float __x, long double __y)
752   { return __builtin_nexttowardf(__x, __y); }
753
754   inline long double
755   nexttoward(long double __x, long double __y)
756   { return __builtin_nexttowardl(__x, __y); }
757
758   template<typename _Tp>
759     inline typename __gnu_cxx::__promote<_Tp>::__type
760     nexttoward(_Tp __x, long double __y)
761     {
762       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
763       return nexttoward(__type(__x), __y);
764     }
765
766   using std::pow;
767
768   inline float
769   remainder(float __x, float __y)
770   { return __builtin_remainderf(__x, __y); }
771
772   inline long double
773   remainder(long double __x, long double __y)
774   { return __builtin_remainderl(__x, __y); }
775
776   template<typename _Tp, typename _Up>
777     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
778     remainder(_Tp __x, _Up __y)
779     {
780       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
781       return remainder(__type(__x), __type(__y));
782     }
783
784   inline float
785   remquo(float __x, float __y, int* __pquo)
786   { return __builtin_remquof(__x, __y, __pquo); }
787
788   inline long double
789   remquo(long double __x, long double __y, int* __pquo)
790   { return __builtin_remquol(__x, __y, __pquo); }
791
792   template<typename _Tp, typename _Up>
793     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
794     remquo(_Tp __x, _Up __y, int* __pquo)
795     {
796       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
797       return remquo(__type(__x), __type(__y), __pquo);
798     }
799
800   inline float
801   rint(float __x)
802   { return __builtin_rintf(__x); }
803
804   inline long double
805   rint(long double __x)
806   { return __builtin_rintl(__x); }
807
808   template<typename _Tp>
809     inline typename __gnu_cxx::__promote<_Tp>::__type
810     rint(_Tp __x)
811     {
812       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
813       return rint(__type(__x));
814     }
815
816   inline float
817   round(float __x)
818   { return __builtin_roundf(__x); }
819
820   inline long double
821   round(long double __x)
822   { return __builtin_roundl(__x); }
823
824   template<typename _Tp>
825     inline typename __gnu_cxx::__promote<_Tp>::__type
826     round(_Tp __x)
827     {
828       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
829       return round(__type(__x));
830     }
831
832   inline float
833   scalbln(float __x, long __ex)
834   { return __builtin_scalblnf(__x, __ex); }
835
836   inline long double
837   scalbln(long double __x, long __ex)
838   { return __builtin_scalblnl(__x, __ex); }
839
840   template<typename _Tp>
841     inline typename __gnu_cxx::__promote<_Tp>::__type 
842     scalbln(_Tp __x, long __ex)
843     {
844       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
845       return scalbln(__type(__x), __ex);
846     }
847  
848   inline float
849   scalbn(float __x, int __ex)
850   { return __builtin_scalbnf(__x, __ex); }
851
852   inline long double
853   scalbn(long double __x, int __ex)
854   { return __builtin_scalbnl(__x, __ex); }
855
856   template<typename _Tp>
857     inline typename __gnu_cxx::__promote<_Tp>::__type 
858     scalbn(_Tp __x, int __ex)
859     {
860       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
861       return scalbn(__type(__x), __ex);
862     }
863
864   using std::sin;
865   using std::sinh;
866   using std::sqrt;
867   using std::tan;
868   using std::tanh;
869
870   inline float
871   tgamma(float __x)
872   { return __builtin_tgammaf(__x); }
873
874   inline long double
875   tgamma(long double __x)
876   { return __builtin_tgammal(__x); }
877
878   template<typename _Tp>
879     inline typename __gnu_cxx::__promote<_Tp>::__type 
880     tgamma(_Tp __x)
881     {
882       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
883       return tgamma(__type(__x));
884     }
885  
886   inline float
887   trunc(float __x)
888   { return __builtin_truncf(__x); }
889
890   inline long double
891   trunc(long double __x)
892   { return __builtin_truncl(__x); }
893
894   template<typename _Tp>
895     inline typename __gnu_cxx::__promote<_Tp>::__type 
896     trunc(_Tp __x)
897     {
898       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
899       return trunc(__type(__x));
900     }
901
902 #endif
903
904 _GLIBCXX_END_NAMESPACE_TR1
905 }