#include #include #include namespace mp = boost::multiprecision; mp::cpp_dec_float_1000 calc(const mp::cpp_dec_float_1000& const_value) { mp::cpp_dec_float_1000 sum = 0; for (int k = 1; k <= 10000; ++k) { sum += pow(const_value, k) / boost::math::factorial(k); } return sum; } int main() { mp::cpp_dec_float_1000 result = calc(log(mp::cpp_dec_float_1000(2)); std::cout << result << std::endl; return 0; }