creating math constants of variable precision using Boost mpfr_float, such as pi or e

蓝咒 提交于 2019-12-02 08:59:58

The constants embedded in the Boost headers have a limited precision, and you've hit that limit. If you need a higher-precision version of pi (for instance), you'll need to bring it yourself.

For instance, the definition of boost::math::constants::pi in the headers is:

  BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884e+00, "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00")

https://github.com/boostorg/math/blob/master/include/boost/math/constants/constants.hpp

(This definition only gives 110 digits past the decimal place, by the way. Any digits you're getting beyond that are likely to be incorrect!)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!