Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

cpp_dec_float

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

Class template cpp_dec_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 three template parameters:

Digits10

The number of decimal digits precision the type should support. Note that this type does not normally perform any dynamic memory allocation, and as a result the Digits10 template argument should not be set too high or the class's size will grow unreasonably large.

ExponentType

A signed integer type that represents the exponent of the number

Allocator

The allocator used: defaults to type void, meaning all storage is within the class, and no dynamic allocation is performed, but can be set to a standard library allocator if dynamic allocation makes more sense.

The type of number_category<cpp_int<Args...> >::type is mpl::int_<number_kind_floating_point>.

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


PrevUpHomeNext