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 #ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
00038 #define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1
00039
00040 namespace std
00041 {
00042 namespace tr1
00043 {
00044
00045 namespace __detail
00046 {
00047
00048
00049
00050
00051 template<typename _Tp>
00052 struct __floating_point_constant
00053 {
00054 static const _Tp __value;
00055 };
00056
00057
00058
00059 template<typename _Tp>
00060 struct __numeric_constants
00061 {
00062
00063 static _Tp __pi() throw()
00064 { return static_cast<_Tp>(3.1415926535897932384626433832795029L); }
00065
00066 static _Tp __pi_2() throw()
00067 { return static_cast<_Tp>(1.5707963267948966192313216916397514L); }
00068
00069 static _Tp __pi_3() throw()
00070 { return static_cast<_Tp>(1.0471975511965977461542144610931676L); }
00071
00072 static _Tp __pi_4() throw()
00073 { return static_cast<_Tp>(0.7853981633974483096156608458198757L); }
00074
00075 static _Tp __1_pi() throw()
00076 { return static_cast<_Tp>(0.3183098861837906715377675267450287L); }
00077
00078 static _Tp __2_sqrtpi() throw()
00079 { return static_cast<_Tp>(1.1283791670955125738961589031215452L); }
00080
00081 static _Tp __sqrt2() throw()
00082 { return static_cast<_Tp>(1.4142135623730950488016887242096981L); }
00083
00084 static _Tp __sqrt3() throw()
00085 { return static_cast<_Tp>(1.7320508075688772935274463415058723L); }
00086
00087 static _Tp __sqrtpio2() throw()
00088 { return static_cast<_Tp>(1.2533141373155002512078826424055226L); }
00089
00090 static _Tp __sqrt1_2() throw()
00091 { return static_cast<_Tp>(0.7071067811865475244008443621048490L); }
00092
00093 static _Tp __lnpi() throw()
00094 { return static_cast<_Tp>(1.1447298858494001741434273513530587L); }
00095
00096 static _Tp __gamma_e() throw()
00097 { return static_cast<_Tp>(0.5772156649015328606065120900824024L); }
00098
00099 static _Tp __euler() throw()
00100 { return static_cast<_Tp>(2.7182818284590452353602874713526625L); }
00101 };
00102
00103
00104 #if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
00105
00106
00107
00108
00109
00110 template<typename _Tp>
00111 inline bool __isnan(const _Tp __x)
00112 {
00113 return std::isnan(__x);
00114 }
00115
00116 #else
00117
00118 template<typename _Tp>
00119 inline bool __isnan(const _Tp __x)
00120 {
00121 return __builtin_isnan(__x);
00122 }
00123
00124 template<>
00125 inline bool __isnan<float>(const float __x)
00126 {
00127 return __builtin_isnanf(__x);
00128 }
00129
00130 template<>
00131 inline bool __isnan<long double>(const long double __x)
00132 {
00133 return __builtin_isnanl(__x);
00134 }
00135
00136 #endif
00137
00138 }
00139
00140 }
00141 }
00142
00143 #endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
00144