00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ROOT_Math_Util
00014 #define ROOT_Math_Util
00015
00016 #include <string>
00017 #include <sstream>
00018
00019 #include <cmath>
00020 #include <limits>
00021
00022 namespace ROOT {
00023
00024 namespace Math {
00025
00026
00027
00028
00029
00030
00031 namespace Util {
00032
00033
00034
00035
00036 template<class T>
00037 std::string ToString(const T& val)
00038 {
00039 std::ostringstream buf;
00040 buf << val;
00041
00042 std::string ret = buf.str();
00043 return ret;
00044 }
00045
00046
00047
00048
00049
00050 inline double EvalLog(double x) {
00051
00052 #ifdef __CINT__
00053 static const double epsilon = 2.*2.2250738585072014e-308;
00054 #else
00055 static const double epsilon = 2.*std::numeric_limits<double>::min();
00056 #endif
00057 if(x<= epsilon)
00058 return x/epsilon + std::log(epsilon) - 1;
00059 else
00060 return std::log(x);
00061 }
00062
00063 }
00064
00065
00066 }
00067
00068 }
00069
00070
00071 #endif