special_function_util.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
00043 #define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1
00044
00045 namespace std
00046 {
00047 namespace tr1
00048 {
00049
00050 namespace __detail
00051 {
00052
00053
00054
00055
00056 template<typename _Tp>
00057 struct __floating_point_constant
00058 {
00059 static const _Tp __value;
00060 };
00061
00062
00063
00064 template<typename _Tp>
00065 struct __numeric_constants
00066 {
00067
00068 static _Tp __pi() throw()
00069 { return static_cast<_Tp>(3.1415926535897932384626433832795029L); }
00070
00071 static _Tp __pi_2() throw()
00072 { return static_cast<_Tp>(1.5707963267948966192313216916397514L); }
00073
00074 static _Tp __pi_3() throw()
00075 { return static_cast<_Tp>(1.0471975511965977461542144610931676L); }
00076
00077 static _Tp __pi_4() throw()
00078 { return static_cast<_Tp>(0.7853981633974483096156608458198757L); }
00079
00080 static _Tp __1_pi() throw()
00081 { return static_cast<_Tp>(0.3183098861837906715377675267450287L); }
00082
00083 static _Tp __2_sqrtpi() throw()
00084 { return static_cast<_Tp>(1.1283791670955125738961589031215452L); }
00085
00086 static _Tp __sqrt2() throw()
00087 { return static_cast<_Tp>(1.4142135623730950488016887242096981L); }
00088
00089 static _Tp __sqrt3() throw()
00090 { return static_cast<_Tp>(1.7320508075688772935274463415058723L); }
00091
00092 static _Tp __sqrtpio2() throw()
00093 { return static_cast<_Tp>(1.2533141373155002512078826424055226L); }
00094
00095 static _Tp __sqrt1_2() throw()
00096 { return static_cast<_Tp>(0.7071067811865475244008443621048490L); }
00097
00098 static _Tp __lnpi() throw()
00099 { return static_cast<_Tp>(1.1447298858494001741434273513530587L); }
00100
00101 static _Tp __gamma_e() throw()
00102 { return static_cast<_Tp>(0.5772156649015328606065120900824024L); }
00103
00104 static _Tp __euler() throw()
00105 { return static_cast<_Tp>(2.7182818284590452353602874713526625L); }
00106 };
00107
00108
00109 #if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
00110
00111
00112
00113
00114
00115 template<typename _Tp>
00116 inline bool __isnan(const _Tp __x)
00117 {
00118 return std::isnan(__x);
00119 }
00120
00121 #else
00122
00123 template<typename _Tp>
00124 inline bool __isnan(const _Tp __x)
00125 {
00126 return __builtin_isnan(__x);
00127 }
00128
00129 template<>
00130 inline bool __isnan<float>(const float __x)
00131 {
00132 return __builtin_isnanf(__x);
00133 }
00134
00135 template<>
00136 inline bool __isnan<long double>(const long double __x)
00137 {
00138 return __builtin_isnanl(__x);
00139 }
00140
00141 #endif
00142
00143 }
00144
00145 }
00146 }
00147
00148 #endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
00149