物理実験のシミュレーションを実行しているので、非常に高い浮動小数点精度 (16 桁以上) が必要です。Boost.Multiprecision を使用していますが、何を試しても 16 桁を超える精度は得られません。たとえば、C++ と eclipse コンパイラを使用してシミュレーションを実行します。
#include <boost/math/constants/constants.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <iostream>
#include <limits>
using boost::multiprecision::cpp_dec_float_50;
void main()
{
cpp_dec_float_50 my_num= cpp_dec_float_50(0.123456789123456789123456789);
std::cout.precision(std::numeric_limits<cpp_dec_float_50>::digits10);
std::cout << my_num << std::endl;
}
出力は次のとおりです。
0.12345678912345678379658409085095627233386039733887
^
ただし、次のようにする必要があります。
0.123456789123456789123456789
ご覧のとおり、16 桁以降は正しくありません。なんで?