I am running physical simulation using c++, and for precise results I am using boost::multiprecision. so far I used the cpp_dec_float_50 type, however ,now I need to test the simulations for diffrent variables with different precision.
so, how do I create new type, for example, cpp_dec_float_27(27 digits precision)?
I tried to change the template code:
namespace boost{ namespace multiprecision{
template <unsigned Digits10, class ExponentType = boost::int32_t, class Allocator = void>
class cpp_dec_float;
typedef number<cpp_dec_float<50> > cpp_dec_float_50;
typedef number<cpp_dec_float<100> > cpp_dec_float_100;
}} // namespaces
but I got a lot of issues.
If I understood correctly you are trying to change your boost installation, which you should never do, because rest of boost sources probably depends on it.
If you want to define your own precision you need a simple typedef:
typedef number<cpp_dec_float<27> > cpp_dec_float27;
and you are ready to go.
However if your functions depends on type cpp_dec_float100 you might wanna consider using template of those functions to accept multiple precision.