Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent > Class Template Reference

#include <cpp_bin_float.hpp>

Public Types

typedef cpp_int_backend
< is_void< Allocator >::value?bit_count:0,
bit_count, is_void< Allocator >
::value?unsigned_magnitude:signed_magnitude,
unchecked, Allocator > 
rep_type
 
typedef cpp_int_backend
< is_void< Allocator >::value?2
*bit_count:0, 2 *bit_count,
is_void< Allocator >::value?unsigned_magnitude:signed_magnitude,
unchecked, Allocator > 
double_rep_type
 
typedef rep_type::signed_types signed_types
 
typedef rep_type::unsigned_types unsigned_types
 
typedef boost::mpl::list
< double, long double > 
float_types
 
typedef Exponent exponent_type
 

Public Member Functions

 BOOST_STATIC_ASSERT_MSG (MinExponent >=min_exponent_limit,"Template parameter MinExponent is too negative for our internal logic to function correctly, sorry!")
 
 BOOST_STATIC_ASSERT_MSG (MaxExponent<=max_exponent_limit,"Template parameter MaxExponent is too large for our internal logic to function correctly, sorry!")
 
 BOOST_STATIC_ASSERT_MSG (MinExponent<=0,"Template parameter MinExponent can not be positive!")
 
 BOOST_STATIC_ASSERT_MSG (MaxExponent >=0,"Template parameter MaxExponent can not be negative!")
 
 cpp_bin_float ()
 
 cpp_bin_float (const cpp_bin_float &o)
 
template<unsigned D, digit_base_type B, class A , class E , E MinE, E MaxE>
 cpp_bin_float (const cpp_bin_float< D, B, A, E, MinE, MaxE > &o, typename boost::enable_if_c<(bit_count >=cpp_bin_float< D, B, A, E, MinE, MaxE >::bit_count)>::type const *=0)
 
template<unsigned D, digit_base_type B, class A , class E , E MinE, E MaxE>
 cpp_bin_float (const cpp_bin_float< D, B, A, E, MinE, MaxE > &o, typename boost::disable_if_c<(bit_count >=cpp_bin_float< D, B, A, E, MinE, MaxE >::bit_count)>::type const *=0)
 
template<class Float >
 cpp_bin_float (const Float &f, typename boost::enable_if_c< (number_category< Float >::value==number_kind_floating_point)&&(std::numeric_limits< Float >::digits<=(int) bit_count)&&(std::numeric_limits< Float >::radix==2) >::type const *=0)
 
cpp_bin_floatoperator= (const cpp_bin_float &o)
 
template<unsigned D, digit_base_type B, class A , class E , E MinE, E MaxE>
cpp_bin_floatoperator= (const cpp_bin_float< D, B, A, E, MinE, MaxE > &o)
 
template<class Float >
boost::enable_if_c
< (number_category< Float >
::value==number_kind_floating_point)&&(std::numeric_limits
< Float >::digits<=(int)
bit_count)&&(std::numeric_limits
< Float >::radix==2),
cpp_bin_float & >::type 
operator= (const Float &f)
 
template<class Float >
boost::enable_if_c
< is_floating_point< Float >
::value, cpp_bin_float & >
::type 
assign_float (Float f)
 
template<class Float >
boost::enable_if_c
< (number_category< Float >
::value==number_kind_floating_point)&&!is_floating_point
< Float >::value,
cpp_bin_float & >::type 
assign_float (Float f)
 
template<class I >
boost::enable_if< is_integral
< I >, cpp_bin_float & >::type 
operator= (const I &i)
 
cpp_bin_floatoperator= (const char *s)
 
void swap (cpp_bin_float &o) BOOST_NOEXCEPT
 
std::string str (std::streamsize dig, std::ios_base::fmtflags f) const
 
void negate ()
 
int compare (const cpp_bin_float &o) const BOOST_NOEXCEPT
 
template<class A >
int compare (const A &o) const BOOST_NOEXCEPT
 
rep_typebits ()
 
const rep_typebits () const
 
exponent_typeexponent ()
 
const exponent_typeexponent () const
 
bool & sign ()
 
const bool & sign () const
 
void check_invariants ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 

Static Public Attributes

static const unsigned bit_count = DigitBase == digit_base_2 ? Digits : (Digits * 1000uL) / 301uL + ((Digits * 1000uL) % 301 ? 2u : 1u)
 
static const exponent_type max_exponent_limit = boost::integer_traits<exponent_type>::const_max - 2 * static_cast<exponent_type>(bit_count)
 
static const exponent_type min_exponent_limit = boost::integer_traits<exponent_type>::const_min + 2 * static_cast<exponent_type>(bit_count)
 
static const exponent_type max_exponent = MaxExponent == 0 ? max_exponent_limit : MaxExponent
 
static const exponent_type min_exponent = MinExponent == 0 ? min_exponent_limit : MinExponent
 
static const exponent_type exponent_zero = max_exponent + 1
 
static const exponent_type exponent_infinity = max_exponent + 2
 
static const exponent_type exponent_nan = max_exponent + 3
 

Member Typedef Documentation

template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
typedef cpp_int_backend<is_void<Allocator>::value ? 2 * bit_count : 0, 2 * bit_count, is_void<Allocator>::value ? unsigned_magnitude : signed_magnitude, unchecked, Allocator> boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::double_rep_type
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
typedef Exponent boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::exponent_type
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
typedef boost::mpl::list<double, long double> boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::float_types
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
typedef cpp_int_backend<is_void<Allocator>::value ? bit_count : 0, bit_count, is_void<Allocator>::value ? unsigned_magnitude : signed_magnitude, unchecked, Allocator> boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::rep_type
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
typedef rep_type::signed_types boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::signed_types
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
typedef rep_type::unsigned_types boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::unsigned_types

Constructor & Destructor Documentation

template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::cpp_bin_float ( )
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::cpp_bin_float ( const cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent > &  o)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<unsigned D, digit_base_type B, class A , class E , E MinE, E MaxE>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::cpp_bin_float ( const cpp_bin_float< D, B, A, E, MinE, MaxE > &  o,
typename boost::enable_if_c<(bit_count = cpp_bin_float<D, B, A, E, MinE, MaxE>::bit_count 
) const
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<unsigned D, digit_base_type B, class A , class E , E MinE, E MaxE>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::cpp_bin_float ( const cpp_bin_float< D, B, A, E, MinE, MaxE > &  o,
typename boost::disable_if_c<(bit_count = cpp_bin_float<D, B, A, E, MinE, MaxE>::bit_count 
) const
inlineexplicit
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<class Float >
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::cpp_bin_float ( const Float &  f)
inline

Member Function Documentation

template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<class Float >
boost::enable_if_c<is_floating_point<Float>::value, cpp_bin_float&>::type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::assign_float ( Float  f)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<class Float >
boost::enable_if_c< (number_category<Float>::value == number_kind_floating_point) && !is_floating_point<Float>::value , cpp_bin_float&>::type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::assign_float ( Float  f)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const rep_type& boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::bits ( ) const
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::BOOST_STATIC_ASSERT_MSG ( MinExponent >=  min_exponent_limit,
"Template parameter MinExponent is too negative for our internal logic to function  correctly,
sorry!"   
)
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::BOOST_STATIC_ASSERT_MSG ( MaxExponent<=  max_exponent_limit,
"Template parameter MaxExponent is too large for our internal logic to function  correctly,
sorry!"   
)
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::BOOST_STATIC_ASSERT_MSG ( MinExponent<=  0,
"Template parameter MinExponent can not be positive!"   
)
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::BOOST_STATIC_ASSERT_MSG ( MaxExponent >=  0,
"Template parameter MaxExponent can not be negative!"   
)
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
void boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::check_invariants ( )
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
int boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::compare ( const cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent > &  o) const
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<class A >
int boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::compare ( const A &  o) const
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type& boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::exponent ( ) const
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
cpp_bin_float& boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::operator= ( const cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent > &  o)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<unsigned D, digit_base_type B, class A , class E , E MinE, E MaxE>
cpp_bin_float& boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::operator= ( const cpp_bin_float< D, B, A, E, MinE, MaxE > &  o)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<class Float >
boost::enable_if_c< (number_category<Float>::value == number_kind_floating_point) && (std::numeric_limits<Float>::digits <= (int)bit_count) && (std::numeric_limits<Float>::radix == 2), cpp_bin_float&>::type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::operator= ( const Float &  f)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
template<class Archive >
void boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::serialize ( Archive &  ar,
const unsigned  int 
)
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const bool& boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::sign ( ) const
inline
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
void boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::swap ( cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent > &  o)
inline

Member Data Documentation

template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const unsigned boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::bit_count = DigitBase == digit_base_2 ? Digits : (Digits * 1000uL) / 301uL + ((Digits * 1000uL) % 301 ? 2u : 1u)
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::exponent_infinity = max_exponent + 2
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::exponent_nan = max_exponent + 3
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::exponent_zero = max_exponent + 1
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::max_exponent = MaxExponent == 0 ? max_exponent_limit : MaxExponent
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::max_exponent_limit = boost::integer_traits<exponent_type>::const_max - 2 * static_cast<exponent_type>(bit_count)
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::min_exponent = MinExponent == 0 ? min_exponent_limit : MinExponent
static
template<unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
const exponent_type boost::multiprecision::backends::cpp_bin_float< Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent >::min_exponent_limit = boost::integer_traits<exponent_type>::const_min + 2 * static_cast<exponent_type>(bit_count)
static

The documentation for this class was generated from the following files: