Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

gmp_float

namespace boost{ namespace multiprecision{

template <unsigned Digits10>
class gmp_float;

typedef number<gmp_float<50> >    mpf_float_50;
typedef number<gmp_float<100> >   mpf_float_100;
typedef number<gmp_float<500> >   mpf_float_500;
typedef number<gmp_float<1000> >  mpf_float_1000;
typedef number<gmp_float<0> >     mpf_float;

}} // namespaces

Class template gmp_float fulfils all of the requirements for a Backend type. Its members and non-member functions are deliberately not documented: these are considered implementation details that are subject to change.

The class takes a single template parameter - Digits10 - which is the number of decimal digits precision the type should support. When this parameter is zero, then the precision can be set at runtime via number::default_precision and number::precision. Note that this type does not in any way change the GMP library's global state (for example it does not change the default precision of the mpf_t data type), therefore you can safely mix this type with existing code that uses GMP, and also mix gmp_floats of differing precision.

The type of number_category<cpp_int<Args...> >::type is std::integral_constant<int, number_kind_floating_point>.

More information on this type can be found in the tutorial.


PrevUpHomeNext