| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
#ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H |
| 37 |
#define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1 |
| 38 |
|
| 39 |
namespace std _GLIBCXX_VISIBILITY(default) |
| 40 |
{ |
| 41 |
_GLIBCXX_BEGIN_NAMESPACE_VERSION |
| 42 |
|
| 43 |
#if _GLIBCXX_USE_STD_SPEC_FUNCS |
| 44 |
#elif defined(_GLIBCXX_TR1_CMATH) |
| 45 |
namespace tr1 |
| 46 |
{ |
| 47 |
#else |
| 48 |
# error do not include this header directly, use <cmath> or <tr1/cmath> |
| 49 |
#endif |
| 50 |
namespace __detail |
| 51 |
{ |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
template<typename _Tp> |
| 56 |
struct __floating_point_constant |
| 57 |
{ |
| 58 |
static const _Tp __value; |
| 59 |
}; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
template<typename _Tp> |
| 64 |
struct __numeric_constants |
| 65 |
{ |
| 66 |
|
| 67 |
static _Tp __pi() throw() |
| 68 |
{ return static_cast<_Tp>(3.1415926535897932384626433832795029L); } |
| 69 |
|
| 70 |
static _Tp __pi_2() throw() |
| 71 |
{ return static_cast<_Tp>(1.5707963267948966192313216916397514L); } |
| 72 |
|
| 73 |
static _Tp __pi_3() throw() |
| 74 |
{ return static_cast<_Tp>(1.0471975511965977461542144610931676L); } |
| 75 |
|
| 76 |
static _Tp __pi_4() throw() |
| 77 |
{ return static_cast<_Tp>(0.7853981633974483096156608458198757L); } |
| 78 |
|
| 79 |
static _Tp __1_pi() throw() |
| 80 |
{ return static_cast<_Tp>(0.3183098861837906715377675267450287L); } |
| 81 |
|
| 82 |
static _Tp __2_sqrtpi() throw() |
| 83 |
{ return static_cast<_Tp>(1.1283791670955125738961589031215452L); } |
| 84 |
|
| 85 |
static _Tp __sqrt2() throw() |
| 86 |
{ return static_cast<_Tp>(1.4142135623730950488016887242096981L); } |
| 87 |
|
| 88 |
static _Tp __sqrt3() throw() |
| 89 |
{ return static_cast<_Tp>(1.7320508075688772935274463415058723L); } |
| 90 |
|
| 91 |
static _Tp __sqrtpio2() throw() |
| 92 |
{ return static_cast<_Tp>(1.2533141373155002512078826424055226L); } |
| 93 |
|
| 94 |
static _Tp __sqrt1_2() throw() |
| 95 |
{ return static_cast<_Tp>(0.7071067811865475244008443621048490L); } |
| 96 |
|
| 97 |
static _Tp __lnpi() throw() |
| 98 |
{ return static_cast<_Tp>(1.1447298858494001741434273513530587L); } |
| 99 |
|
| 100 |
static _Tp __gamma_e() throw() |
| 101 |
{ return static_cast<_Tp>(0.5772156649015328606065120900824024L); } |
| 102 |
|
| 103 |
static _Tp __euler() throw() |
| 104 |
{ return static_cast<_Tp>(2.7182818284590452353602874713526625L); } |
| 105 |
}; |
| 106 |
|
| 107 |
|
| 108 |
#if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
template<typename _Tp> |
| 115 |
inline bool __isnan(_Tp __x) |
| 116 |
{ return std::isnan(__x); } |
| 117 |
|
| 118 |
#else |
| 119 |
|
| 120 |
template<typename _Tp> |
| 121 |
inline bool __isnan(const _Tp __x) |
| 122 |
{ return __builtin_isnan(__x); } |
| 123 |
|
| 124 |
template<> |
| 125 |
inline bool __isnan<float>(float __x) |
| 126 |
{ return __builtin_isnanf(__x); } |
| 127 |
|
| 128 |
template<> |
| 129 |
inline bool __isnan<long double>(long double __x) |
| 130 |
{ return __builtin_isnanl(__x); } |
| 131 |
|
| 132 |
#endif |
| 133 |
} |
| 134 |
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH) |
| 135 |
} |
| 136 |
#endif |
| 137 |
|
| 138 |
_GLIBCXX_END_NAMESPACE_VERSION |
| 139 |
} |
| 140 |
|
| 141 |
#endif |
| 142 |
|