我尝试使用boost库中的zeta函数:
double dz1 = boost::math::zeta<double> (1.0);
当我运行程序时,我得到了:
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::domain_error> >'
what(): Error in function boost::math::zeta<e>: Evaluation of zeta function at pole 1
Aborted (core dumped)'
有人知道发生了什么事吗?
答案 0 :(得分:3)
黎曼zeta函数是一个无限的总和:
只有当参数的实部更多时才收敛,然后1.如果它等于1,则系列发散并且总和给出无穷大。
因此,当您使用1.0调用该函数时,库会引发错误。
有用的链接: