]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/multiprecision/cpp_bin_float.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / multiprecision / cpp_bin_float.hpp
index 8d31e408cd840280c8727e8fb715a0a25299be2d..dad8d7b31059dcfb0b56123c2c7e368845ac8668 100644 (file)
@@ -1,7 +1,7 @@
 ///////////////////////////////////////////////////////////////
 //  Copyright 2013 John Maddock. Distributed under the Boost
 //  Software License, Version 1.0. (See accompanying file
-//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
+//  LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
 
 #ifndef BOOST_MATH_CPP_BIN_FLOAT_HPP
 #define BOOST_MATH_CPP_BIN_FLOAT_HPP
 #include <quadmath.h>
 #endif
 
-namespace boost{ namespace multiprecision{ namespace backends{
+namespace boost {
+namespace multiprecision {
+namespace backends {
 
 enum digit_base_type
 {
-   digit_base_2 = 2, 
+   digit_base_2  = 2,
    digit_base_10 = 10
 };
 
 #ifdef BOOST_MSVC
 #pragma warning(push)
-#pragma warning(disable:4522 6326)  // multiple assignment operators specified, comparison of two constants
+#pragma warning(disable : 4522 6326) // multiple assignment operators specified, comparison of two constants
 #endif
 
-namespace detail{
+namespace detail {
 
 template <class U>
 inline typename enable_if_c<is_unsigned<U>::value, bool>::type is_negative(U) { return false; }
 template <class S>
 inline typename disable_if_c<is_unsigned<S>::value, bool>::type is_negative(S s) { return s < 0; }
 
-}
+template <class Float, int, bool = number_category<Float>::value == number_kind_floating_point>
+struct is_cpp_bin_float_implicitly_constructible_from_type
+{
+   static const bool value = false;
+};
+
+template <class Float, int bit_count>
+struct is_cpp_bin_float_implicitly_constructible_from_type<Float, bit_count, true>
+{
+   static const bool value = (std::numeric_limits<Float>::digits <= (int)bit_count) && (std::numeric_limits<Float>::radix == 2) && std::numeric_limits<Float>::is_specialized
+#ifdef BOOST_HAS_FLOAT128
+                             && !boost::is_same<Float, __float128>::value
+#endif
+                             && (is_floating_point<Float>::value || is_number<Float>::value);
+};
+
+template <class Float, int, bool = number_category<Float>::value == number_kind_floating_point>
+struct is_cpp_bin_float_explicitly_constructible_from_type
+{
+   static const bool value = false;
+};
+
+template <class Float, int bit_count>
+struct is_cpp_bin_float_explicitly_constructible_from_type<Float, bit_count, true>
+{
+   static const bool value = (std::numeric_limits<Float>::digits > (int)bit_count) && (std::numeric_limits<Float>::radix == 2) && std::numeric_limits<Float>::is_specialized
+#ifdef BOOST_HAS_FLOAT128
+                             && !boost::is_same<Float, __float128>::value
+#endif
+       ;
+};
+
+} // namespace detail
 
 template <unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
 class cpp_bin_float
 {
-public:
-   static const unsigned bit_count = DigitBase == digit_base_2 ? Digits : (Digits * 1000uL) / 301uL + (((Digits * 1000uL) % 301) ? 2u : 1u);
-   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;
+ public:
+   static const unsigned                                                                                                                                                          bit_count = DigitBase == digit_base_2 ? Digits : (Digits * 1000uL) / 301uL + (((Digits * 1000uL) % 301) ? 2u : 1u);
+   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 typename rep_type::signed_types                        signed_types;
-   typedef typename rep_type::unsigned_types                      unsigned_types;
-   typedef boost::mpl::list<float, double, long double>           float_types;
-   typedef Exponent                                               exponent_type;
+   typedef typename rep_type::signed_types              signed_types;
+   typedef typename rep_type::unsigned_types            unsigned_types;
+   typedef boost::mpl::list<float, double, long double> float_types;
+   typedef Exponent                                     exponent_type;
 
    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);
@@ -71,117 +105,98 @@ public:
    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_zero     = max_exponent + 1;
    static const exponent_type exponent_infinity = max_exponent + 2;
-   static const exponent_type exponent_nan = max_exponent + 3;
-
-private:
+   static const exponent_type exponent_nan      = max_exponent + 3;
 
-   rep_type m_data;
+ private:
+   rep_type      m_data;
    exponent_type m_exponent;
-   bool m_sign;
-public:
+   bool          m_sign;
+
+ public:
    cpp_bin_float() BOOST_MP_NOEXCEPT_IF(noexcept(rep_type())) : m_data(), m_exponent(exponent_zero), m_sign(false) {}
 
-   cpp_bin_float(const cpp_bin_float &o) BOOST_MP_NOEXCEPT_IF(noexcept(rep_type(std::declval<const rep_type&>())))
-      : m_data(o.m_data), m_exponent(o.m_exponent), m_sign(o.m_sign) {}
+   cpp_bin_float(const cpp_bin_floato) BOOST_MP_NOEXCEPT_IF(noexcept(rep_type(std::declval<const rep_type&>())))
+       : m_data(o.m_data), m_exponent(o.m_exponent), m_sign(o.m_sign) {}
 
    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)
+   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)
    {
       *this = o;
    }
    template <unsigned D, digit_base_type B, class A, class E, E MinE, E MaxE>
-   explicit 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)
-      : m_exponent(o.exponent()), m_sign(o.sign()) 
+   explicit 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)
+       : m_exponent(o.exponent()), m_sign(o.sign())
    {
       *this = o;
    }
    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)
-         && (std::numeric_limits<Float>::is_specialized)
-#ifdef BOOST_HAS_FLOAT128
-         && !boost::is_same<Float, __float128>::value
-#endif
-      >::type const* = 0)
-      : m_data(), m_exponent(0), m_sign(false)
+   cpp_bin_float(const Float& f,
+                 typename boost::enable_if_c<detail::is_cpp_bin_float_implicitly_constructible_from_type<Float, bit_count>::value>::type const* = 0)
+       : m_data(), m_exponent(0), m_sign(false)
    {
       this->assign_float(f);
    }
 
    template <class Float>
    explicit 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)
-         && (std::numeric_limits<Float>::is_specialized)
-#ifdef BOOST_HAS_FLOAT128
-        && !boost::is_same<Float, __float128>::value
-#endif
->::type const* = 0)
-      : m_data(), m_exponent(0), m_sign(false)
+                          typename boost::enable_if_c<detail::is_cpp_bin_float_explicitly_constructible_from_type<Float, bit_count>::value>::type const* = 0)
+       : m_data(), m_exponent(0), m_sign(false)
    {
       this->assign_float(f);
    }
 #ifdef BOOST_HAS_FLOAT128
    template <class Float>
    cpp_bin_float(const Float& f,
-      typename boost::enable_if_c<
-      boost::is_same<Float, __float128>::value
-      && ((int)bit_count >= 113)
-      >::type const* = 0)
-      : m_data(), m_exponent(0), m_sign(false)
+                 typename boost::enable_if_c<
+                     boost::is_same<Float, __float128>::value && ((int)bit_count >= 113)>::type const* = 0)
+       : m_data(), m_exponent(0), m_sign(false)
    {
       this->assign_float(f);
    }
    template <class Float>
    explicit cpp_bin_float(const Float& f,
-      typename boost::enable_if_c<
-      boost::is_same<Float, __float128>::value
-      && ((int)bit_count < 113)
-      >::type const* = 0)
-      : m_data(), m_exponent(0), m_sign(false)
+                          typename boost::enable_if_c<
+                              boost::is_same<Float, __float128>::value && ((int)bit_count < 113)>::type const* = 0)
+       : m_data(), m_exponent(0), m_sign(false)
    {
       this->assign_float(f);
    }
 #endif
-   cpp_bin_float& operator=(const cpp_bin_float &o) BOOST_MP_NOEXCEPT_IF(noexcept(std::declval<rep_type&>() = std::declval<const rep_type&>()))
+   cpp_bin_float& operator=(const cpp_bin_floato) BOOST_MP_NOEXCEPT_IF(noexcept(std::declval<rep_type&>() = std::declval<const rep_type&>()))
    {
-      m_data = o.m_data;
+      m_data     = o.m_data;
       m_exponent = o.m_exponent;
-      m_sign = o.m_sign;
+      m_sign     = o.m_sign;
       return *this;
    }
 
    template <unsigned D, digit_base_type B, class A, class E, E MinE, E MaxE>
-   cpp_bin_float& operator=(const cpp_bin_float<D, B, A, E, MinE, MaxE> &f)
+   cpp_bin_float& operator=(const cpp_bin_float<D, B, A, E, MinE, MaxE>f)
    {
-      switch(eval_fpclassify(f))
+      switch (eval_fpclassify(f))
       {
       case FP_ZERO:
-         m_data = limb_type(0);
-         m_sign = f.sign();
+         m_data     = limb_type(0);
+         m_sign     = f.sign();
          m_exponent = exponent_zero;
          break;
       case FP_NAN:
-         m_data = limb_type(0);
-         m_sign = false;
+         m_data     = limb_type(0);
+         m_sign     = false;
          m_exponent = exponent_nan;
-         break;;
+         break;
+         ;
       case FP_INFINITE:
-         m_data = limb_type(0);
-         m_sign = f.sign();
+         m_data     = limb_type(0);
+         m_sign     = f.sign();
          m_exponent = exponent_infinity;
          break;
       default:
          typename cpp_bin_float<D, B, A, E, MinE, MaxE>::rep_type b(f.bits());
          this->exponent() = f.exponent() + (E)bit_count - (E)cpp_bin_float<D, B, A, E, MinE, MaxE>::bit_count;
-         this->sign() = f.sign();
+         this->sign()     = f.sign();
          copy_and_round(*this, b);
       }
       return *this;
@@ -189,17 +204,19 @@ public:
 #ifdef BOOST_HAS_FLOAT128
    template <class Float>
    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) || (boost::is_same<Float, __float128>::value)), cpp_bin_float&>::type 
-      operator=(const Float& f)
+       (number_category<Float>::value == number_kind_floating_point)
+           //&& (std::numeric_limits<Float>::digits <= (int)bit_count)
+           && ((std::numeric_limits<Float>::radix == 2) || (boost::is_same<Float, __float128>::value)),
+       cpp_bin_float&>::type
+   operator=(const Float& f)
 #else
    template <class Float>
    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), cpp_bin_float&>::type 
-      operator=(const Float& f)
+       (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)
 #endif
    {
       return assign_float(f);
@@ -207,32 +224,32 @@ public:
 
 #ifdef BOOST_HAS_FLOAT128
    template <class Float>
-   typename boost::enable_if_c<boost::is_same<Float, __float128>::value, cpp_bin_float& >::type assign_float(Float f)
+   typename boost::enable_if_c<boost::is_same<Float, __float128>::value, cpp_bin_float&>::type assign_float(Float f)
    {
       using default_ops::eval_add;
       typedef typename boost::multiprecision::detail::canonical<int, cpp_bin_float>::type bf_int_type;
-      if(f == 0)
+      if (f == 0)
       {
-         m_data = limb_type(0);
-         m_sign = (signbitq(f) > 0);
+         m_data     = limb_type(0);
+         m_sign     = (signbitq(f) > 0);
          m_exponent = exponent_zero;
          return *this;
       }
-      else if(isnanq(f))
+      else if (isnanq(f))
       {
-         m_data = limb_type(0);
-         m_sign = false;
+         m_data     = limb_type(0);
+         m_sign     = false;
          m_exponent = exponent_nan;
          return *this;
       }
-      else if(isinfq(f))
+      else if (isinfq(f))
       {
-         m_data = limb_type(0);
-         m_sign = (f < 0);
+         m_data     = limb_type(0);
+         m_sign     = (f < 0);
          m_exponent = exponent_infinity;
          return *this;
       }
-      if(f < 0)
+      if (f < 0)
       {
          *this = -f;
          this->negate();
@@ -240,14 +257,14 @@ public:
       }
 
       typedef typename mpl::front<unsigned_types>::type ui_type;
-      m_data = static_cast<ui_type>(0u);
-      m_sign = false;
+      m_data     = static_cast<ui_type>(0u);
+      m_sign     = false;
       m_exponent = 0;
 
       static const int bits = sizeof(int) * CHAR_BIT - 1;
-      int e;
+      int              e;
       f = frexpq(f, &e);
-      while(f)
+      while (f)
       {
          f = ldexpq(f, bits);
          e -= bits;
@@ -274,25 +291,25 @@ public:
       using default_ops::eval_add;
       typedef typename boost::multiprecision::detail::canonical<int, cpp_bin_float>::type bf_int_type;
 
-      switch((boost::math::fpclassify)(f))
+      switch ((boost::math::fpclassify)(f))
       {
       case FP_ZERO:
-         m_data = limb_type(0);
-         m_sign = ((boost::math::signbit)(f) > 0);
+         m_data     = limb_type(0);
+         m_sign     = ((boost::math::signbit)(f) > 0);
          m_exponent = exponent_zero;
          return *this;
       case FP_NAN:
-         m_data = limb_type(0);
-         m_sign = false;
+         m_data     = limb_type(0);
+         m_sign     = false;
          m_exponent = exponent_nan;
          return *this;
       case FP_INFINITE:
-         m_data = limb_type(0);
-         m_sign = (f < 0);
+         m_data     = limb_type(0);
+         m_sign     = (f < 0);
          m_exponent = exponent_infinity;
          return *this;
       }
-      if(f < 0)
+      if (f < 0)
       {
          *this = -f;
          this->negate();
@@ -300,14 +317,14 @@ public:
       }
 
       typedef typename mpl::front<unsigned_types>::type ui_type;
-      m_data = static_cast<ui_type>(0u);
-      m_sign = false;
+      m_data     = static_cast<ui_type>(0u);
+      m_sign     = false;
       m_exponent = 0;
 
       static const int bits = sizeof(int) * CHAR_BIT - 1;
-      int e;
+      int              e;
       f = frexp(f, &e);
-      while(f)
+      while (f)
       {
          f = ldexp(f, bits);
          e -= bits;
@@ -328,39 +345,38 @@ public:
 
    template <class Float>
    typename boost::enable_if_c<
-      (number_category<Float>::value == number_kind_floating_point) 
-         && !boost::is_floating_point<Float>::value
-         /*&& (std::numeric_limits<number<Float> >::radix == 2)*/, 
-      cpp_bin_float&>::type assign_float(Float f)
+       (number_category<Float>::value == number_kind_floating_point) && !boost::is_floating_point<Float>::value && (number_category<Float>::value == number_kind_floating_point),
+       cpp_bin_float&>::type
+   assign_float(Float f)
    {
       BOOST_MATH_STD_USING
       using default_ops::eval_add;
-      using default_ops::eval_get_sign;
       using default_ops::eval_convert_to;
+      using default_ops::eval_get_sign;
       using default_ops::eval_subtract;
 
-      typedef typename boost::multiprecision::detail::canonical<int, Float>::type f_int_type;
+      typedef typename boost::multiprecision::detail::canonical<int, Float>::type         f_int_type;
       typedef typename boost::multiprecision::detail::canonical<int, cpp_bin_float>::type bf_int_type;
 
-      switch(eval_fpclassify(f))
+      switch (eval_fpclassify(f))
       {
       case FP_ZERO:
-         m_data = limb_type(0);
-         m_sign = ((boost::math::signbit)(f) > 0);
+         m_data     = limb_type(0);
+         m_sign     = (eval_get_sign(f) > 0);
          m_exponent = exponent_zero;
          return *this;
       case FP_NAN:
-         m_data = limb_type(0);
-         m_sign = false;
+         m_data     = limb_type(0);
+         m_sign     = false;
          m_exponent = exponent_nan;
          return *this;
       case FP_INFINITE:
-         m_data = limb_type(0);
-         m_sign = (f < 0);
+         m_data     = limb_type(0);
+         m_sign     = eval_get_sign(f) < 0;
          m_exponent = exponent_infinity;
          return *this;
       }
-      if(eval_get_sign(f) < 0)
+      if (eval_get_sign(f) < 0)
       {
          f.negate();
          *this = f;
@@ -369,14 +385,14 @@ public:
       }
 
       typedef typename mpl::front<unsigned_types>::type ui_type;
-      m_data = static_cast<ui_type>(0u);
-      m_sign = false;
+      m_data     = static_cast<ui_type>(0u);
+      m_sign     = false;
       m_exponent = 0;
 
       static const int bits = sizeof(int) * CHAR_BIT - 1;
-      int e;
+      int              e;
       eval_frexp(f, f, &e);
-      while(eval_get_sign(f) != 0)
+      while (eval_get_sign(f) != 0)
       {
          eval_ldexp(f, f, bits);
          e -= bits;
@@ -387,58 +403,63 @@ public:
          eval_add(*this, static_cast<bf_int_type>(ipart));
       }
       m_exponent += e;
-      if(m_exponent > max_exponent)
+      if (m_exponent > max_exponent)
          m_exponent = exponent_infinity;
-      if(m_exponent < min_exponent)
+      if (m_exponent < min_exponent)
       {
-         m_data = limb_type(0u);
+         m_data     = limb_type(0u);
          m_exponent = exponent_zero;
-         m_sign = ((boost::math::signbit)(f) > 0);
+         m_sign     = (eval_get_sign(f) > 0);
       }
-      else if(eval_get_sign(m_data) == 0)
+      else if (eval_get_sign(m_data) == 0)
       {
          m_exponent = exponent_zero;
-         m_sign = ((boost::math::signbit)(f) > 0);
+         m_sign     = (eval_get_sign(f) > 0);
       }
       return *this;
    }
-
+   template <class B, expression_template_option et>
+   cpp_bin_float& assign_float(const number<B, et>& f)
+   {
+      return assign_float(f.backend());
+   }
+   
    template <class I>
    typename boost::enable_if<is_integral<I>, cpp_bin_float&>::type operator=(const I& i)
    {
       using default_ops::eval_bit_test;
-      if(!i)
+      if (!i)
       {
-         m_data = static_cast<limb_type>(0);
+         m_data     = static_cast<limb_type>(0);
          m_exponent = exponent_zero;
-         m_sign = false;
+         m_sign     = false;
       }
       else
       {
-         typedef typename make_unsigned<I>::type ui_type;
-         ui_type fi = static_cast<ui_type>(boost::multiprecision::detail::unsigned_abs(i));
+         typedef typename make_unsigned<I>::type                                            ui_type;
+         ui_type                                                                            fi = static_cast<ui_type>(boost::multiprecision::detail::unsigned_abs(i));
          typedef typename boost::multiprecision::detail::canonical<ui_type, rep_type>::type ar_type;
-         m_data = static_cast<ar_type>(fi);
+         m_data         = static_cast<ar_type>(fi);
          unsigned shift = msb(fi);
-         if(shift >= bit_count)
+         if (shift >= bit_count)
          {
             m_exponent = static_cast<Exponent>(shift);
-            m_data = static_cast<ar_type>(fi >> (shift + 1 - bit_count));
+            m_data     = static_cast<ar_type>(fi >> (shift + 1 - bit_count));
          }
          else
          {
             m_exponent = static_cast<Exponent>(shift);
             eval_left_shift(m_data, bit_count - shift - 1);
          }
-         BOOST_ASSERT(eval_bit_test(m_data, bit_count-1));
+         BOOST_ASSERT(eval_bit_test(m_data, bit_count - 1));
          m_sign = detail::is_negative(i);
       }
       return *this;
    }
 
-   cpp_bin_float& operator=(const char *s);
+   cpp_bin_float& operator=(const chars);
 
-   void swap(cpp_bin_float &o) BOOST_NOEXCEPT
+   void swap(cpp_bin_floato) BOOST_NOEXCEPT
    {
       m_data.swap(o.m_data);
       std::swap(m_exponent, o.m_exponent);
@@ -449,29 +470,29 @@ public:
 
    void negate()
    {
-      if(m_exponent != exponent_nan)
+      if (m_exponent != exponent_nan)
          m_sign = !m_sign;
    }
 
-   int compare(const cpp_bin_float &o) const BOOST_NOEXCEPT
+   int compare(const cpp_bin_floato) const BOOST_NOEXCEPT
    {
-      if(m_sign != o.m_sign)
+      if (m_sign != o.m_sign)
          return (m_exponent == exponent_zero) && (m_exponent == o.m_exponent) ? 0 : m_sign ? -1 : 1;
       int result;
-      if(m_exponent == exponent_nan)
+      if (m_exponent == exponent_nan)
          return -1;
-      else if(m_exponent != o.m_exponent)
+      else if (m_exponent != o.m_exponent)
       {
-         if(m_exponent == exponent_zero)
+         if (m_exponent == exponent_zero)
             result = -1;
-         else if(o.m_exponent == exponent_zero)
+         else if (o.m_exponent == exponent_zero)
             result = 1;
-         else 
+         else
             result = m_exponent > o.m_exponent ? 1 : -1;
       }
       else
          result = m_data.compare(o.m_data);
-      if(m_sign)
+      if (m_sign)
          result = -result;
       return result;
    }
@@ -483,17 +504,17 @@ public:
       return compare(b);
    }
 
-   rep_type& bits() { return m_data; }
-   const rep_type& bits()const { return m_data; }
-   exponent_type& exponent() { return m_exponent; }
-   const exponent_type& exponent()const { return m_exponent; }
-   bool& sign() { return m_sign; }
-   const bool& sign()const { return m_sign; }
-   void check_invariants()
+   rep_type&            bits() { return m_data; }
+   const rep_type&      bits() const { return m_data; }
+   exponent_type&       exponent() { return m_exponent; }
+   const exponent_type& exponent() const { return m_exponent; }
+   bool&                sign() { return m_sign; }
+   const bool&          sign() const { return m_sign; }
+   void                 check_invariants()
    {
       using default_ops::eval_bit_test;
       using default_ops::eval_is_zero;
-      if((m_exponent <= max_exponent) && (m_exponent >= min_exponent))
+      if ((m_exponent <= max_exponent) && (m_exponent >= min_exponent))
       {
          BOOST_ASSERT(eval_bit_test(m_data, bit_count - 1));
       }
@@ -504,12 +525,12 @@ public:
          BOOST_ASSERT(eval_is_zero(m_data));
       }
    }
-   template<class Archive>
-   void serialize(Archive & ar, const unsigned int /*version*/)
+   template <class Archive>
+   void serialize(Archive& ar, const unsigned int /*version*/)
    {
-      ar & m_data;
-      ar & m_exponent;
-      ar & m_sign;
+      ar& boost::make_nvp("data", m_data);
+      ar& boost::make_nvp("exponent", m_exponent);
+      ar& boost::make_nvp("sign", m_sign);
    }
 };
 
@@ -518,28 +539,28 @@ public:
 #endif
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class Int>
-inline void copy_and_round(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, Int &arg, int bits_to_keep = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
+inline void copy_and_round(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, Int& arg, int bits_to_keep = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
 {
    // Precondition: exponent of res must have been set before this function is called
    // as we may need to adjust it based on how many bits_to_keep in arg are set.
-   using default_ops::eval_msb;
-   using default_ops::eval_lsb;
-   using default_ops::eval_left_shift;
    using default_ops::eval_bit_test;
-   using default_ops::eval_right_shift;
-   using default_ops::eval_increment;
    using default_ops::eval_get_sign;
+   using default_ops::eval_increment;
+   using default_ops::eval_left_shift;
+   using default_ops::eval_lsb;
+   using default_ops::eval_msb;
+   using default_ops::eval_right_shift;
 
    // cancellation may have resulted in arg being all zeros:
-   if(eval_get_sign(arg) == 0)
+   if (eval_get_sign(arg) == 0)
    {
       res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
-      res.sign() = false;
-      res.bits() = static_cast<limb_type>(0u);
+      res.sign()     = false;
+      res.bits()     = static_cast<limb_type>(0u);
       return;
    }
    int msb = eval_msb(arg);
-   if(static_cast<int>(bits_to_keep) > msb + 1)
+   if (static_cast<int>(bits_to_keep) > msb + 1)
    {
       // Must have had cancellation in subtraction,
       // or be converting from a narrower type, so shift left:
@@ -547,27 +568,27 @@ inline void copy_and_round(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
       eval_left_shift(res.bits(), bits_to_keep - msb - 1);
       res.exponent() -= static_cast<Exponent>(bits_to_keep - msb - 1);
    }
-   else if(static_cast<int>(bits_to_keep) < msb + 1)
+   else if (static_cast<int>(bits_to_keep) < msb + 1)
    {
-      // We have more bits_to_keep than we need, so round as required, 
+      // We have more bits_to_keep than we need, so round as required,
       // first get the rounding bit:
       bool roundup = eval_bit_test(arg, msb - bits_to_keep);
       // Then check for a tie:
-      if(roundup && (msb - bits_to_keep == (int)eval_lsb(arg)))
+      if (roundup && (msb - bits_to_keep == (int)eval_lsb(arg)))
       {
          // Ties round towards even:
-         if(!eval_bit_test(arg, msb - bits_to_keep + 1))
+         if (!eval_bit_test(arg, msb - bits_to_keep + 1))
             roundup = false;
       }
       // Shift off the bits_to_keep we don't need:
       eval_right_shift(arg, msb - bits_to_keep + 1);
       res.exponent() += static_cast<Exponent>(msb - bits_to_keep + 1);
-      if(roundup)
+      if (roundup)
       {
          eval_increment(arg);
-         if(bits_to_keep)
+         if (bits_to_keep)
          {
-            if(eval_bit_test(arg, bits_to_keep))
+            if (eval_bit_test(arg, bits_to_keep))
             {
                // This happens very very rairly, all the bits left after
                // truncation must be 1's and we're rounding up an order of magnitude:
@@ -582,7 +603,7 @@ inline void copy_and_round(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
             ++bits_to_keep;
          }
       }
-      if(bits_to_keep != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
+      if (bits_to_keep != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
       {
          // Normalize result when we're rounding to fewer bits than we can hold, only happens in conversions
          // to narrower types:
@@ -595,7 +616,7 @@ inline void copy_and_round(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
    {
       res.bits() = arg;
    }
-   if(!bits_to_keep && !res.bits().limbs()[0])
+   if (!bits_to_keep && !res.bits().limbs()[0])
    {
       // We're keeping zero bits and did not round up, so result is zero:
       res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
@@ -604,28 +625,28 @@ inline void copy_and_round(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
    // Result must be normalized:
    BOOST_ASSERT(((int)eval_msb(res.bits()) == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1));
 
-   if(res.exponent() > cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent)
+   if (res.exponent() > cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent)
    {
       // Overflow:
       res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity;
-      res.bits() = static_cast<limb_type>(0u);
+      res.bits()     = static_cast<limb_type>(0u);
    }
-   else if(res.exponent() < cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent)
+   else if (res.exponent() < cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent)
    {
       // Underflow:
       res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
-      res.bits() = static_cast<limb_type>(0u);
+      res.bits()     = static_cast<limb_type>(0u);
    }
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void do_eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &b)
+inline void do_eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& b)
 {
-   if(a.exponent() < b.exponent())
+   if (a.exponent() < b.exponent())
    {
       bool s = a.sign();
       do_eval_add(res, b, a);
-      if(res.sign() != s)
+      if (res.sign() != s)
          res.negate();
       return;
    }
@@ -638,17 +659,17 @@ inline void do_eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
    typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::double_rep_type dt;
 
    // Special cases first:
-   switch(a.exponent())
+   switch (a.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    {
-      bool s = a.sign();
-      res = b;
+      bool s     = a.sign();
+      res        = b;
       res.sign() = s;
       return;
    }
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
-      if(b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan)
+      if (b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan)
          res = b;
       else
          res = a;
@@ -657,14 +678,14 @@ inline void do_eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
       res = a;
       return; // result is still a NaN.
    }
-   switch(b.exponent())
+   switch (b.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       res = a;
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       res = b;
-      if(res.sign())
+      if (res.sign())
          res.negate();
       return; // result is infinite.
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
@@ -675,8 +696,8 @@ inline void do_eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
    BOOST_STATIC_ASSERT(boost::integer_traits<exponent_type>::const_max - cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count > cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent);
 
    bool s = a.sign();
-   dt = a.bits();
-   if(a.exponent() > (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + b.exponent())
+   dt     = a.bits();
+   if (a.exponent() > (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + b.exponent())
    {
       res.exponent() = a.exponent();
    }
@@ -688,40 +709,40 @@ inline void do_eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
       res.exponent() = a.exponent() - e_diff;
       eval_add(dt, b.bits());
    }
-   
+
    copy_and_round(res, dt);
    res.check_invariants();
-   if(res.sign() != s)
+   if (res.sign() != s)
       res.negate();
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void do_eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &b)
+inline void do_eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& b)
 {
-   using default_ops::eval_subtract;
    using default_ops::eval_bit_test;
    using default_ops::eval_decrement;
+   using default_ops::eval_subtract;
 
    typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::double_rep_type dt;
-   
+
    // Special cases first:
-   switch(a.exponent())
+   switch (a.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
-      if(b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan)
+      if (b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan)
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       else
       {
          bool s = a.sign();
-         res = b;
-         if(res.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero)
+         res    = b;
+         if (res.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero)
             res.sign() = false;
-         else if(res.sign() == s)
+         else if (res.sign() == s)
             res.negate();
       }
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
-      if((b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan) || (b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity))
+      if ((b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan) || (b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity))
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       else
          res = a;
@@ -730,15 +751,15 @@ inline void do_eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponen
       res = a;
       return; // result is still a NaN.
    }
-   switch(b.exponent())
+   switch (b.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       res = a;
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity;
-      res.sign() = !a.sign();
-      res.bits() = static_cast<limb_type>(0u);
+      res.sign()     = !a.sign();
+      res.bits()     = static_cast<limb_type>(0u);
       return; // result is a NaN.
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
       res = b;
@@ -746,19 +767,19 @@ inline void do_eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponen
    }
 
    bool s = a.sign();
-   if((a.exponent() > b.exponent()) || ((a.exponent() == b.exponent()) && a.bits().compare(b.bits()) >= 0))
+   if ((a.exponent() > b.exponent()) || ((a.exponent() == b.exponent()) && a.bits().compare(b.bits()) >= 0))
    {
       dt = a.bits();
-      if(a.exponent() <= (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + b.exponent())
+      if (a.exponent() <= (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + b.exponent())
       {
          typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type e_diff = a.exponent() - b.exponent();
          eval_left_shift(dt, e_diff);
          res.exponent() = a.exponent() - e_diff;
          eval_subtract(dt, b.bits());
       }
-      else if(a.exponent() == (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + b.exponent() + 1)
+      else if (a.exponent() == (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + b.exponent() + 1)
       {
-         if(eval_lsb(b.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
+         if (eval_lsb(b.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
          {
             eval_left_shift(dt, 1);
             eval_decrement(dt);
@@ -773,16 +794,16 @@ inline void do_eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponen
    else
    {
       dt = b.bits();
-      if(b.exponent() <= (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + a.exponent())
+      if (b.exponent() <= (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + a.exponent())
       {
          typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type e_diff = a.exponent() - b.exponent();
          eval_left_shift(dt, -e_diff);
          res.exponent() = b.exponent() + e_diff;
          eval_subtract(dt, a.bits());
       }
-      else if(b.exponent() == (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + a.exponent() + 1)
+      else if (b.exponent() == (int)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count + a.exponent() + 1)
       {
-         if(eval_lsb(a.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
+         if (eval_lsb(a.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
          {
             eval_left_shift(dt, 1);
             eval_decrement(dt);
@@ -795,70 +816,70 @@ inline void do_eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponen
          res.exponent() = b.exponent();
       s = !s;
    }
-   
+
    copy_and_round(res, dt);
-   if(res.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero)
+   if (res.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero)
       res.sign() = false;
-   else if(res.sign() != s)
+   else if (res.sign() != s)
       res.negate();
    res.check_invariants();
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &b)
+inline void eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& b)
 {
-   if(a.sign() == b.sign())
+   if (a.sign() == b.sign())
       do_eval_add(res, a, b);
    else
       do_eval_subtract(res, a, b);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a)
+inline void eval_add(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a)
 {
    return eval_add(res, res, a);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &b)
+inline void eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& b)
 {
-   if(a.sign() != b.sign())
+   if (a.sign() != b.sign())
       do_eval_add(res, a, b);
    else
       do_eval_subtract(res, a, b);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a)
+inline void eval_subtract(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a)
 {
    return eval_subtract(res, res, a);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &b)
+inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& b)
 {
    using default_ops::eval_bit_test;
    using default_ops::eval_multiply;
 
    // Special cases first:
-   switch(a.exponent())
+   switch (a.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    {
-      if(b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan)
+      if (b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan)
          res = b;
-      else if(b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity)
+      else if (b.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity)
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       else
       {
-         bool s = a.sign() != b.sign();
-         res = a;
+         bool s     = a.sign() != b.sign();
+         res        = a;
          res.sign() = s;
       }
       return;
    }
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
-      switch(b.exponent())
+      switch (b.exponent())
       {
       case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
@@ -867,8 +888,8 @@ inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
          res = b;
          break;
       default:
-         bool s = a.sign() != b.sign();
-         res = a;
+         bool s     = a.sign() != b.sign();
+         res        = a;
          res.sign() = s;
          break;
       }
@@ -877,33 +898,33 @@ inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
       res = a;
       return;
    }
-   if(b.exponent() > cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent)
+   if (b.exponent() > cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent)
    {
-      bool s = a.sign() != b.sign();
-      res = b;
+      bool s     = a.sign() != b.sign();
+      res        = b;
       res.sign() = s;
       return;
    }
-   if((a.exponent() > 0) && (b.exponent() > 0))
+   if ((a.exponent() > 0) && (b.exponent() > 0))
    {
-      if(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent + 2 - a.exponent() < b.exponent())
+      if (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent + 2 - a.exponent() < b.exponent())
       {
          // We will certainly overflow:
-         bool s = a.sign() != b.sign();
+         bool s         = a.sign() != b.sign();
          res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity;
-         res.sign() = s;
-         res.bits() = static_cast<limb_type>(0u);
+         res.sign()     = s;
+         res.bits()     = static_cast<limb_type>(0u);
          return;
       }
    }
-   if((a.exponent() < 0) && (b.exponent() < 0))
+   if ((a.exponent() < 0) && (b.exponent() < 0))
    {
-      if(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent - 2 - a.exponent() > b.exponent())
+      if (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent - 2 - a.exponent() > b.exponent())
       {
          // We will certainly underflow:
          res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
-         res.sign() = a.sign() != b.sign();
-         res.bits() = static_cast<limb_type>(0u);
+         res.sign()     = a.sign() != b.sign();
+         res.bits()     = static_cast<limb_type>(0u);
          return;
       }
    }
@@ -917,29 +938,29 @@ inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent,
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a)
+inline void eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a)
 {
    eval_multiply(res, res, a);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class U>
-inline typename enable_if_c<is_unsigned<U>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const U &b)
+inline typename enable_if_c<is_unsigned<U>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const U& b)
 {
    using default_ops::eval_bit_test;
    using default_ops::eval_multiply;
 
    // Special cases first:
-   switch(a.exponent())
+   switch (a.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    {
-      bool s = a.sign();
-      res = a;
+      bool s     = a.sign();
+      res        = a;
       res.sign() = s;
       return;
    }
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
-      if(b == 0)
+      if (b == 0)
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       else
          res = a;
@@ -949,7 +970,7 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_multiply(cpp_bin_f
       return;
    }
 
-   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::double_rep_type dt;
+   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::double_rep_type                                                                     dt;
    typedef typename boost::multiprecision::detail::canonical<U, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::double_rep_type>::type canon_ui_type;
    eval_multiply(dt, a.bits(), static_cast<canon_ui_type>(b));
    res.exponent() = a.exponent();
@@ -959,69 +980,69 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_multiply(cpp_bin_f
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class U>
-inline typename enable_if_c<is_unsigned<U>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const U &b)
+inline typename enable_if_c<is_unsigned<U>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const U& b)
 {
    eval_multiply(res, res, b);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class S>
-inline typename enable_if_c<is_signed<S>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, const S &b)
+inline typename enable_if_c<is_signed<S>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, const S& b)
 {
    typedef typename make_unsigned<S>::type ui_type;
    eval_multiply(res, a, static_cast<ui_type>(boost::multiprecision::detail::unsigned_abs(b)));
-   if(b < 0)
+   if (b < 0)
       res.negate();
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class S>
-inline typename enable_if_c<is_signed<S>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const S &b)
+inline typename enable_if_c<is_signed<S>::value>::type eval_multiply(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const S& b)
 {
    eval_multiply(res, res, b);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &u, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &v)
+inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& u, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& v)
 {
 #ifdef BOOST_MSVC
 #pragma warning(push)
-#pragma warning(disable:6326)  // comparison of two constants
+#pragma warning(disable : 6326) // comparison of two constants
 #endif
-   using default_ops::eval_subtract;
-   using default_ops::eval_qr;
    using default_ops::eval_bit_test;
    using default_ops::eval_get_sign;
    using default_ops::eval_increment;
+   using default_ops::eval_qr;
+   using default_ops::eval_subtract;
 
    //
    // Special cases first:
    //
-   switch(u.exponent())
+   switch (u.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    {
-      switch(v.exponent())
+      switch (v.exponent())
       {
       case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
          return;
       }
-      bool s = u.sign() != v.sign();
-      res = u;
+      bool s     = u.sign() != v.sign();
+      res        = u;
       res.sign() = s;
       return;
    }
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
    {
-      switch(v.exponent())
+      switch (v.exponent())
       {
       case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
          return;
       }
-      bool s = u.sign() != v.sign();
-      res = u;
+      bool s     = u.sign() != v.sign();
+      res        = u;
       res.sign() = s;
       return;
    }
@@ -1029,19 +1050,19 @@ inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
       res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       return;
    }
-   switch(v.exponent())
+   switch (v.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
-      {
-      bool s = u.sign() != v.sign();
-      res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
+   {
+      bool s     = u.sign() != v.sign();
+      res        = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
       res.sign() = s;
       return;
-      }
+   }
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
-      res.bits() = limb_type(0);
-      res.sign() = u.sign() != v.sign();
+      res.bits()     = limb_type(0);
+      res.sign()     = u.sign() != v.sign();
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
       res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
@@ -1057,38 +1078,38 @@ inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
    //
    // q + r/v = u/v
    //
-   // From this, assuming q has cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count 
+   // From this, assuming q has cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count
    // bits we only need to determine whether
-   // r/v is less than, equal to, or greater than 0.5 to determine rounding - 
+   // r/v is less than, equal to, or greater than 0.5 to determine rounding -
    // this we can do with a shift and comparison.
    //
    // We can set the exponent and sign of the result up front:
    //
-   if((v.exponent() < 0) && (u.exponent() > 0))
+   if ((v.exponent() < 0) && (u.exponent() > 0))
    {
       // Check for overflow:
-      if(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent + v.exponent() < u.exponent() - 1)
+      if (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent + v.exponent() < u.exponent() - 1)
       {
          res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity;
-         res.sign() = u.sign() != v.sign();
-         res.bits() = static_cast<limb_type>(0u);
+         res.sign()     = u.sign() != v.sign();
+         res.bits()     = static_cast<limb_type>(0u);
          return;
       }
    }
-   else if((v.exponent() > 0) && (u.exponent() < 0))
+   else if ((v.exponent() > 0) && (u.exponent() < 0))
    {
       // Check for underflow:
-      if(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent + v.exponent() > u.exponent())
+      if (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent + v.exponent() > u.exponent())
       {
          // We will certainly underflow:
          res.exponent() = cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
-         res.sign() = u.sign() != v.sign();
-         res.bits() = static_cast<limb_type>(0u);
+         res.sign()     = u.sign() != v.sign();
+         res.bits()     = static_cast<limb_type>(0u);
          return;
       }
    }
    res.exponent() = u.exponent() - v.exponent() - 1;
-   res.sign() = u.sign() != v.sign();
+   res.sign()     = u.sign() != v.sign();
    //
    // Now get the quotient and remainder:
    //
@@ -1096,22 +1117,22 @@ inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
    eval_left_shift(t, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count);
    eval_qr(t, t2, q, r);
    //
-   // We now have either "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count" 
-   // or "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count+1" significant 
+   // We now have either "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count"
+   // or "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count+1" significant
    // bits in q.
    //
    static const unsigned limb_bits = sizeof(limb_type) * CHAR_BIT;
-   if(eval_bit_test(q, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count))
+   if (eval_bit_test(q, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count))
    {
       //
-      // OK we have cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count+1 bits, 
+      // OK we have cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count+1 bits,
       // so we already have rounding info,
       // we just need to changes things if the last bit is 1 and either the
       // remainder is non-zero (ie we do not have a tie) or the quotient would
       // be odd if it were shifted to the correct number of bits (ie a tiebreak).
       //
       BOOST_ASSERT((eval_msb(q) == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count));
-      if((q.limbs()[0] & 1u) && (eval_get_sign(r) || (q.limbs()[0] & 2u)))
+      if ((q.limbs()[0] & 1u) && (eval_get_sign(r) || (q.limbs()[0] & 2u)))
       {
          eval_increment(q);
       }
@@ -1131,9 +1152,9 @@ inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
       res.exponent() -= lshift;
       eval_left_shift(r, 1u);
       int c = r.compare(v.bits());
-      if(c == 0)
+      if (c == 0)
          q.limbs()[0] |= static_cast<limb_type>(1u) << (lshift - 1);
-      else if(c > 0)
+      else if (c > 0)
          q.limbs()[0] |= (static_cast<limb_type>(1u) << (lshift - 1)) + static_cast<limb_type>(1u);
    }
    copy_and_round(res, q);
@@ -1143,38 +1164,38 @@ inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Mi
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
    eval_divide(res, res, arg);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class U>
-inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &u, const U &v)
+inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& u, const U& v)
 {
 #ifdef BOOST_MSVC
 #pragma warning(push)
-#pragma warning(disable:6326)  // comparison of two constants
+#pragma warning(disable : 6326) // comparison of two constants
 #endif
-   using default_ops::eval_subtract;
-   using default_ops::eval_qr;
    using default_ops::eval_bit_test;
    using default_ops::eval_get_sign;
    using default_ops::eval_increment;
+   using default_ops::eval_qr;
+   using default_ops::eval_subtract;
 
    //
    // Special cases first:
    //
-   switch(u.exponent())
+   switch (u.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    {
-      if(v == 0)
+      if (v == 0)
       {
          res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
          return;
       }
-      bool s = u.sign() != (v < 0);
-      res = u;
+      bool s     = u.sign() != (v < 0);
+      res        = u;
       res.sign() = s;
       return;
    }
@@ -1185,10 +1206,10 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_flo
       res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       return;
    }
-   if(v == 0)
+   if (v == 0)
    {
-      bool s = u.sign();
-      res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
+      bool s     = u.sign();
+      res        = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
       res.sign() = s;
       return;
    }
@@ -1203,14 +1224,14 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_flo
    // q + r/v = u/v
    //
    // From this, assuming q has "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count" cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count, we only need to determine whether
-   // r/v is less than, equal to, or greater than 0.5 to determine rounding - 
+   // r/v is less than, equal to, or greater than 0.5 to determine rounding -
    // this we can do with a shift and comparison.
    //
    // We can set the exponent and sign of the result up front:
    //
-   int gb = msb(v);
+   int gb         = msb(v);
    res.exponent() = u.exponent() - static_cast<Exponent>(gb) - static_cast<Exponent>(1);
-   res.sign() = u.sign();
+   res.sign()     = u.sign();
    //
    // Now get the quotient and remainder:
    //
@@ -1221,7 +1242,7 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_flo
    // We now have either "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count" or "cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count+1" significant cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count in q.
    //
    static const unsigned limb_bits = sizeof(limb_type) * CHAR_BIT;
-   if(eval_bit_test(q, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count))
+   if (eval_bit_test(q, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count))
    {
       //
       // OK we have cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count+1 cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count, so we already have rounding info,
@@ -1229,7 +1250,7 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_flo
       // remainder is non-zero (ie we do not have a tie).
       //
       BOOST_ASSERT((eval_msb(q) == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count));
-      if((q.limbs()[0] & 1u) && eval_get_sign(r))
+      if ((q.limbs()[0] & 1u) && eval_get_sign(r))
       {
          eval_increment(q);
       }
@@ -1249,9 +1270,9 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_flo
       res.exponent() -= lshift;
       eval_left_shift(r, 1u);
       int c = r.compare(number<typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::double_rep_type>::canonical_value(v));
-      if(c == 0)
+      if (c == 0)
          q.limbs()[0] |= static_cast<limb_type>(1u) << (lshift - 1);
-      else if(c > 0)
+      else if (c > 0)
          q.limbs()[0] |= (static_cast<limb_type>(1u) << (lshift - 1)) + static_cast<limb_type>(1u);
    }
    copy_and_round(res, q);
@@ -1261,56 +1282,54 @@ inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_flo
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class U>
-inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const U &v)
+inline typename enable_if_c<is_unsigned<U>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const U& v)
 {
    eval_divide(res, res, v);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class S>
-inline typename enable_if_c<is_signed<S>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &u, const S &v)
+inline typename enable_if_c<is_signed<S>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& u, const S& v)
 {
    typedef typename make_unsigned<S>::type ui_type;
    eval_divide(res, u, static_cast<ui_type>(boost::multiprecision::detail::unsigned_abs(v)));
-   if(v < 0)
+   if (v < 0)
       res.negate();
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class S>
-inline typename enable_if_c<is_signed<S>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const S &v)
+inline typename enable_if_c<is_signed<S>::value>::type eval_divide(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const S& v)
 {
    eval_divide(res, res, v);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline int eval_get_sign(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline int eval_get_sign(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>arg)
 {
    return arg.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero ? 0 : arg.sign() ? -1 : 1;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline bool eval_is_zero(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline bool eval_is_zero(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>arg)
 {
    return arg.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline bool eval_eq(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &a, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &b)
+inline bool eval_eq(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& a, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& b)
 {
-   if(a.exponent() == b.exponent())
+   if (a.exponent() == b.exponent())
    {
-      if(a.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero)
+      if (a.exponent() == cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero)
          return true;
-      return (a.sign() == b.sign())
-         && (a.bits().compare(b.bits()) == 0)
-         && (a.exponent() != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan);
+      return (a.sign() == b.sign()) && (a.bits().compare(b.bits()) == 0) && (a.exponent() != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan);
    }
    return false;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_convert_to(boost::long_long_type *res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_convert_to(boost::long_long_type* res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       *res = 0;
@@ -1319,25 +1338,24 @@ inline void eval_convert_to(boost::long_long_type *res, const cpp_bin_float<Digi
       BOOST_THROW_EXCEPTION(std::runtime_error("Could not convert NaN to integer."));
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       *res = (std::numeric_limits<boost::long_long_type>::max)();
-      if(arg.sign())
+      if (arg.sign())
          *res = -*res;
       return;
    }
-   typedef typename mpl::if_c < sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type > ::type shift_type;
-   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::rep_type man(arg.bits());
-   shift_type shift 
-      = (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - arg.exponent();
-   if(shift > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
+   typedef typename mpl::if_c<sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type>::type shift_type;
+   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::rep_type                                                                                                                                                              man(arg.bits());
+   shift_type                                                                                                                                                                                                                                        shift = (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - arg.exponent();
+   if (shift > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
    {
       *res = 0;
       return;
    }
-   if(arg.sign() && (arg.compare((std::numeric_limits<boost::long_long_type>::min)()) <= 0))
+   if (arg.sign() && (arg.compare((std::numeric_limits<boost::long_long_type>::min)()) <= 0))
    {
       *res = (std::numeric_limits<boost::long_long_type>::min)();
       return;
    }
-   else if(!arg.sign() && (arg.compare((std::numeric_limits<boost::long_long_type>::max)()) >= 0))
+   else if (!arg.sign() && (arg.compare((std::numeric_limits<boost::long_long_type>::max)()) >= 0))
    {
       *res = (std::numeric_limits<boost::long_long_type>::max)();
       return;
@@ -1362,16 +1380,16 @@ inline void eval_convert_to(boost::long_long_type *res, const cpp_bin_float<Digi
       eval_right_shift(man, shift);
       eval_convert_to(res, man);
    }
-   if(arg.sign())
+   if (arg.sign())
    {
       *res = -*res;
    }
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_convert_to(boost::ulong_long_type *res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_convert_to(boost::ulong_long_type* res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       *res = 0;
@@ -1382,16 +1400,15 @@ inline void eval_convert_to(boost::ulong_long_type *res, const cpp_bin_float<Dig
       *res = (std::numeric_limits<boost::ulong_long_type>::max)();
       return;
    }
-   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::rep_type man(arg.bits());
-   typedef typename mpl::if_c < sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type > ::type shift_type;
-   shift_type shift 
-      = (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - arg.exponent();
-   if(shift > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
+   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::rep_type                                                                                                                                                              man(arg.bits());
+   typedef typename mpl::if_c<sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type>::type shift_type;
+   shift_type                                                                                                                                                                                                                                        shift = (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - arg.exponent();
+   if (shift > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1)
    {
       *res = 0;
       return;
    }
-   else if(shift < 0)
+   else if (shift < 0)
    {
       if (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - shift <= std::numeric_limits<boost::ulong_long_type>::digits)
       {
@@ -1408,18 +1425,18 @@ inline void eval_convert_to(boost::ulong_long_type *res, const cpp_bin_float<Dig
 }
 
 template <class Float, unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline typename boost::enable_if_c<boost::is_float<Float>::value>::type eval_convert_to(Float *res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &original_arg)
+inline typename boost::enable_if_c<boost::is_float<Float>::value>::type eval_convert_to(Float* res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& original_arg)
 {
-   typedef cpp_bin_float<std::numeric_limits<Float>::digits, digit_base_2, void, Exponent, MinE, MaxE>  conv_type;
-   typedef typename common_type<typename conv_type::exponent_type, int>::type                           common_exp_type;
+   typedef cpp_bin_float<std::numeric_limits<Float>::digits, digit_base_2, void, Exponent, MinE, MaxE> conv_type;
+   typedef typename common_type<typename conv_type::exponent_type, int>::type                          common_exp_type;
    //
    // Special cases first:
    //
-   switch(original_arg.exponent())
+   switch (original_arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       *res = 0;
-      if(original_arg.sign())
+      if (original_arg.sign())
          *res = -*res;
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
@@ -1427,36 +1444,36 @@ inline typename boost::enable_if_c<boost::is_float<Float>::value>::type eval_con
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       *res = (std::numeric_limits<Float>::infinity)();
-      if(original_arg.sign())
+      if (original_arg.sign())
          *res = -*res;
       return;
    }
    //
    // Check for super large exponent that must be converted to infinity:
    //
-   if(original_arg.exponent() > std::numeric_limits<Float>::max_exponent)
+   if (original_arg.exponent() > std::numeric_limits<Float>::max_exponent)
    {
       *res = std::numeric_limits<Float>::has_infinity ? std::numeric_limits<Float>::infinity() : (std::numeric_limits<Float>::max)();
-      if(original_arg.sign())
+      if (original_arg.sign())
          *res = -*res;
       return;
    }
    //
-   // Figure out how many digits we will have in our result, 
+   // Figure out how many digits we will have in our result,
    // allowing for a possibly denormalized result:
    //
    common_exp_type digits_to_round_to = std::numeric_limits<Float>::digits;
-   if(original_arg.exponent() < std::numeric_limits<Float>::min_exponent - 1)
+   if (original_arg.exponent() < std::numeric_limits<Float>::min_exponent - 1)
    {
       common_exp_type diff = original_arg.exponent();
       diff -= std::numeric_limits<Float>::min_exponent - 1;
       digits_to_round_to += diff;
    }
-   if(digits_to_round_to < 0)
+   if (digits_to_round_to < 0)
    {
       // Result must be zero:
       *res = 0;
-      if(original_arg.sign())
+      if (original_arg.sign())
          *res = -*res;
       return;
    }
@@ -1464,49 +1481,48 @@ inline typename boost::enable_if_c<boost::is_float<Float>::value>::type eval_con
    // Perform rounding first, then afterwards extract the digits:
    //
    cpp_bin_float<std::numeric_limits<Float>::digits, digit_base_2, Allocator, Exponent, MinE, MaxE> arg;
-   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::rep_type bits(original_arg.bits());
+   typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::rep_type             bits(original_arg.bits());
    arg.exponent() = original_arg.exponent();
    copy_and_round(arg, bits, (int)digits_to_round_to);
    common_exp_type e = arg.exponent();
    e -= cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1;
-   static const unsigned limbs_needed = std::numeric_limits<Float>::digits / (sizeof(*arg.bits().limbs()) * CHAR_BIT)
-      + (std::numeric_limits<Float>::digits % (sizeof(*arg.bits().limbs()) * CHAR_BIT) ? 1 : 0);
-   unsigned first_limb_needed = arg.bits().size() - limbs_needed;
-   *res = 0;
+   static const unsigned limbs_needed      = std::numeric_limits<Float>::digits / (sizeof(*arg.bits().limbs()) * CHAR_BIT) + (std::numeric_limits<Float>::digits % (sizeof(*arg.bits().limbs()) * CHAR_BIT) ? 1 : 0);
+   unsigned              first_limb_needed = arg.bits().size() - limbs_needed;
+   *res                                    = 0;
    e += first_limb_needed * sizeof(*arg.bits().limbs()) * CHAR_BIT;
-   while(first_limb_needed < arg.bits().size())
+   while (first_limb_needed < arg.bits().size())
    {
       *res += std::ldexp(static_cast<Float>(arg.bits().limbs()[first_limb_needed]), static_cast<int>(e));
       ++first_limb_needed;
       e += sizeof(*arg.bits().limbs()) * CHAR_BIT;
    }
-   if(original_arg.sign())
+   if (original_arg.sign())
       *res = -*res;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_frexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg, Exponent *e)
+inline void eval_frexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg, Exponent* e)
 {
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
-      *e = 0;
+      *e  = 0;
       res = arg;
       return;
    }
-   res = arg;
-   *e = arg.exponent() + 1;
+   res            = arg;
+   *e             = arg.exponent() + 1;
    res.exponent() = -1;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class I>
-inline void eval_frexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg, I *pe)
+inline void eval_frexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg, I* pe)
 {
    Exponent e;
    eval_frexp(res, arg, &e);
-   if((e > (std::numeric_limits<I>::max)()) || (e < (std::numeric_limits<I>::min)()))
+   if ((e > (std::numeric_limits<I>::max)()) || (e < (std::numeric_limits<I>::min)()))
    {
       BOOST_THROW_EXCEPTION(std::runtime_error("Exponent was outside of the range of the argument type to frexp."));
    }
@@ -1514,9 +1530,9 @@ inline void eval_frexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Min
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg, Exponent e)
+inline void eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg, Exponent e)
 {
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
@@ -1524,13 +1540,13 @@ inline void eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Min
       res = arg;
       return;
    }
-   if((e > 0) && (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent - e < arg.exponent()))
+   if ((e > 0) && (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent - e < arg.exponent()))
    {
       // Overflow:
-      res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
+      res        = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
       res.sign() = arg.sign();
    }
-   else if((e < 0) && (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent - e > arg.exponent()))
+   else if ((e < 0) && (cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent - e > arg.exponent()))
    {
       // Underflow:
       res = limb_type(0);
@@ -1543,22 +1559,22 @@ inline void eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Min
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class I>
-inline typename enable_if_c<is_unsigned<I>::value>::type eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg, I e)
+inline typename enable_if_c<is_unsigned<I>::value>::type eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg, I e)
 {
    typedef typename make_signed<I>::type si_type;
-   if(e > static_cast<I>((std::numeric_limits<si_type>::max)()))
+   if (e > static_cast<I>((std::numeric_limits<si_type>::max)()))
       res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
    else
       eval_ldexp(res, arg, static_cast<si_type>(e));
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, class I>
-inline typename enable_if_c<is_signed<I>::value>::type eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg, I e)
+inline typename enable_if_c<is_signed<I>::value>::type eval_ldexp(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg, I e)
 {
-   if((e > (std::numeric_limits<Exponent>::max)()) || (e < (std::numeric_limits<Exponent>::min)()))
+   if ((e > (std::numeric_limits<Exponent>::max)()) || (e < (std::numeric_limits<Exponent>::min)()))
    {
       res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity().backend();
-      if(e < 0)
+      if (e < 0)
          res.negate();
    }
    else
@@ -1570,23 +1586,23 @@ inline typename enable_if_c<is_signed<I>::value>::type eval_ldexp(cpp_bin_float<
 */
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_abs(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_abs(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
-   res = arg;
+   res        = arg;
    res.sign() = false;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_fabs(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_fabs(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
-   res = arg;
+   res        = arg;
    res.sign() = false;
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline int eval_fpclassify(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline int eval_fpclassify(const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>arg)
 {
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_zero:
       return FP_ZERO;
@@ -1599,12 +1615,12 @@ inline int eval_fpclassify(const cpp_bin_float<Digits, DigitBase, Allocator, Exp
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_sqrt(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_sqrt(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
-   using default_ops::eval_integer_sqrt;
    using default_ops::eval_bit_test;
    using default_ops::eval_increment;
-   switch(arg.exponent())
+   using default_ops::eval_integer_sqrt;
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
       errno = EDOM;
@@ -1613,18 +1629,18 @@ inline void eval_sqrt(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE
       res = arg;
       return;
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
-      if(arg.sign())
+      if (arg.sign())
       {
-         res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
+         res   = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
          errno = EDOM;
       }
       else
          res = arg;
       return;
    }
-   if(arg.sign())
+   if (arg.sign())
    {
-      res = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
+      res   = std::numeric_limits<number<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN().backend();
       errno = EDOM;
       return;
    }
@@ -1633,26 +1649,26 @@ inline void eval_sqrt(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE
    eval_left_shift(t, arg.exponent() & 1 ? cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count : cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1);
    eval_integer_sqrt(s, r, t);
 
-   if(!eval_bit_test(s, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count))
+   if (!eval_bit_test(s, cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count))
    {
       // We have exactly the right number of cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count in the result, round as required:
-      if(s.compare(r) < 0)
+      if (s.compare(r) < 0)
       {
          eval_increment(s);
       }
    }
    typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type ae = arg.exponent();
-   res.exponent() = ae / 2;
-   if((ae & 1) && (ae < 0))
+   res.exponent()                                                                               = ae / 2;
+   if ((ae & 1) && (ae < 0))
       --res.exponent();
    copy_and_round(res, s);
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_floor(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_floor(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
    using default_ops::eval_increment;
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan:
       errno = EDOM;
@@ -1662,27 +1678,27 @@ inline void eval_floor(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Min
       res = arg;
       return;
    }
-   typedef typename mpl::if_c < sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type > ::type shift_type;
-   shift_type shift = 
-      (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - arg.exponent() - 1;
-   if((arg.exponent() > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent) || (shift <= 0))
+   typedef typename mpl::if_c<sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type>::type shift_type;
+   shift_type                                                                                                                                                                                                                                        shift =
+       (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - arg.exponent() - 1;
+   if ((arg.exponent() > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent) || (shift <= 0))
    {
       // Either arg is already an integer, or a special value:
       res = arg;
       return;
    }
-   if(shift >= (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
+   if (shift >= (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
    {
       res = static_cast<signed_limb_type>(arg.sign() ? -1 : 0);
       return;
    }
    bool fractional = (shift_type)eval_lsb(arg.bits()) < shift;
-   res = arg;
+   res             = arg;
    eval_right_shift(res.bits(), shift);
-   if(fractional && res.sign())
+   if (fractional && res.sign())
    {
       eval_increment(res.bits());
-      if(eval_msb(res.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - shift)
+      if (eval_msb(res.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - shift)
       {
          // Must have extended result by one bit in the increment:
          --shift;
@@ -1693,10 +1709,10 @@ inline void eval_floor(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, Min
 }
 
 template <unsigned Digits, digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
-inline void eval_ceil(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> &arg)
+inline void eval_ceil(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& res, const cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>& arg)
 {
    using default_ops::eval_increment;
-   switch(arg.exponent())
+   switch (arg.exponent())
    {
    case cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity:
       errno = EDOM;
@@ -1706,28 +1722,28 @@ inline void eval_ceil(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE
       res = arg;
       return;
    }
-   typedef typename mpl::if_c < sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type > ::type shift_type;
-   shift_type shift = (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - arg.exponent() - 1;
-   if((arg.exponent() > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent) || (shift <= 0))
+   typedef typename mpl::if_c<sizeof(typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type) < sizeof(int), int, typename cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type>::type shift_type;
+   shift_type                                                                                                                                                                                                                                        shift = (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - arg.exponent() - 1;
+   if ((arg.exponent() > (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent) || (shift <= 0))
    {
       // Either arg is already an integer, or a special value:
       res = arg;
       return;
    }
-   if(shift >= (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
+   if (shift >= (shift_type)cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count)
    {
-      bool s = arg.sign(); // takes care of signed zeros
-      res = static_cast<signed_limb_type>(arg.sign() ? 0 : 1);
+      bool s     = arg.sign(); // takes care of signed zeros
+      res        = static_cast<signed_limb_type>(arg.sign() ? 0 : 1);
       res.sign() = s;
       return;
    }
    bool fractional = (shift_type)eval_lsb(arg.bits()) < shift;
-   res = arg;
+   res             = arg;
    eval_right_shift(res.bits(), shift);
-   if(fractional && !res.sign())
+   if (fractional && !res.sign())
    {
       eval_increment(res.bits());
-      if(eval_msb(res.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - shift)
+      if (eval_msb(res.bits()) != cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1 - shift)
       {
          // Must have extended result by one bit in the increment:
          --shift;
@@ -1737,13 +1753,13 @@ inline void eval_ceil(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE
    eval_left_shift(res.bits(), shift);
 }
 
-template<unsigned D1, backends::digit_base_type B1, class A1, class E1, E1 M1, E1 M2>
+template <unsigned D1, backends::digit_base_type B1, class A1, class E1, E1 M1, E1 M2>
 int eval_signbit(const cpp_bin_float<D1, B1, A1, E1, M1, M2>& val)
 {
    return val.sign();
 }
 
-template<unsigned D1, backends::digit_base_type B1, class A1, class E1, E1 M1, E1 M2>
+template <unsigned D1, backends::digit_base_type B1, class A1, class E1, E1 M1, E1 M2>
 inline std::size_t hash_value(const cpp_bin_float<D1, B1, A1, E1, M1, M2>& val)
 {
    std::size_t result = hash_value(val.bits());
@@ -1752,26 +1768,27 @@ inline std::size_t hash_value(const cpp_bin_float<D1, B1, A1, E1, M1, M2>& val)
    return result;
 }
 
-
 } // namespace backends
 
 #ifdef BOOST_NO_SFINAE_EXPR
 
-namespace detail{
+namespace detail {
 
-template<unsigned D1, backends::digit_base_type B1, class A1, class E1, E1 M1, E1 M2, unsigned D2, backends::digit_base_type B2, class A2, class E2, E2 M3, E2 M4>
-struct is_explicitly_convertible<backends::cpp_bin_float<D1, B1, A1, E1, M1, M2>, backends::cpp_bin_float<D2, B2, A2, E2, M3, M4> > : public mpl::true_ {};
-template<class FloatT, unsigned D2, backends::digit_base_type B2, class A2, class E2, E2 M3, E2 M4>
-struct is_explicitly_convertible<FloatT, backends::cpp_bin_float<D2, B2, A2, E2, M3, M4> > : public boost::is_floating_point<FloatT> {};
+template <unsigned D1, backends::digit_base_type B1, class A1, class E1, E1 M1, E1 M2, unsigned D2, backends::digit_base_type B2, class A2, class E2, E2 M3, E2 M4>
+struct is_explicitly_convertible<backends::cpp_bin_float<D1, B1, A1, E1, M1, M2>, backends::cpp_bin_float<D2, B2, A2, E2, M3, M4> > : public mpl::true_
+{};
+template <class FloatT, unsigned D2, backends::digit_base_type B2, class A2, class E2, E2 M3, E2 M4>
+struct is_explicitly_convertible<FloatT, backends::cpp_bin_float<D2, B2, A2, E2, M3, M4> > : public boost::is_floating_point<FloatT>
+{};
 
-}
+} // namespace detail
 #endif
 
-template<unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Exponent, Exponent MinE, Exponent MaxE, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
+template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Exponent, Exponent MinE, Exponent MaxE, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
 inline boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates>
-copysign BOOST_PREVENT_MACRO_SUBSTITUTION(
-   const boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates>& a,
-   const boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates>& b)
+    copysign BOOST_PREVENT_MACRO_SUBSTITUTION(
+        const boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates>& a,
+        const boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates>& b)
 {
    boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> res(a);
    res.backend().sign() = b.backend().sign();
@@ -1779,32 +1796,34 @@ copysign BOOST_PREVENT_MACRO_SUBSTITUTION(
 }
 
 using backends::cpp_bin_float;
-using backends::digit_base_2;
 using backends::digit_base_10;
+using backends::digit_base_2;
 
-template<unsigned Digits, backends::digit_base_type DigitBase, class Exponent, Exponent MinE, Exponent MaxE, class Allocator>
-struct number_category<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > : public boost::mpl::int_<boost::multiprecision::number_kind_floating_point>{};
+template <unsigned Digits, backends::digit_base_type DigitBase, class Exponent, Exponent MinE, Exponent MaxE, class Allocator>
+struct number_category<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > : public boost::mpl::int_<boost::multiprecision::number_kind_floating_point>
+{};
 
-template<unsigned Digits, backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
+template <unsigned Digits, backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE>
 struct expression_template_default<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> >
 {
    static const expression_template_option value = is_void<Allocator>::value ? et_off : et_on;
 };
 
-typedef number<backends::cpp_bin_float<50> > cpp_bin_float_50;
+typedef number<backends::cpp_bin_float<50> >  cpp_bin_float_50;
 typedef number<backends::cpp_bin_float<100> > cpp_bin_float_100;
 
-typedef number<backends::cpp_bin_float<24, backends::digit_base_2, void, boost::int16_t, -126, 127>, et_off> cpp_bin_float_single;
-typedef number<backends::cpp_bin_float<53, backends::digit_base_2, void, boost::int16_t, -1022, 1023>, et_off> cpp_bin_float_double;
-typedef number<backends::cpp_bin_float<64, backends::digit_base_2, void, boost::int16_t, -16382, 16383>, et_off> cpp_bin_float_double_extended;
-typedef number<backends::cpp_bin_float<113, backends::digit_base_2, void, boost::int16_t, -16382, 16383>, et_off> cpp_bin_float_quad;
+typedef number<backends::cpp_bin_float<24, backends::digit_base_2, void, boost::int16_t, -126, 127>, et_off>        cpp_bin_float_single;
+typedef number<backends::cpp_bin_float<53, backends::digit_base_2, void, boost::int16_t, -1022, 1023>, et_off>      cpp_bin_float_double;
+typedef number<backends::cpp_bin_float<64, backends::digit_base_2, void, boost::int16_t, -16382, 16383>, et_off>    cpp_bin_float_double_extended;
+typedef number<backends::cpp_bin_float<113, backends::digit_base_2, void, boost::int16_t, -16382, 16383>, et_off>   cpp_bin_float_quad;
+typedef number<backends::cpp_bin_float<237, backends::digit_base_2, void, boost::int32_t, -262142, 262143>, et_off> cpp_bin_float_oct;
 
 } // namespace multiprecision
 
 namespace math {
 
-   using boost::multiprecision::signbit;
-   using boost::multiprecision::copysign;
+using boost::multiprecision::copysign;
+using boost::multiprecision::signbit;
 
 } // namespace math
 
@@ -1813,49 +1832,50 @@ namespace math {
 #include <boost/multiprecision/cpp_bin_float/io.hpp>
 #include <boost/multiprecision/cpp_bin_float/transcendental.hpp>
 
-namespace std{
+namespace std {
 
 //
 // numeric_limits [partial] specializations for the types declared in this header:
 //
-template<unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
+template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
 class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >
 {
    typedef boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> number_type;
-public:
+
+ public:
    BOOST_STATIC_CONSTEXPR bool is_specialized = true;
-   static number_type (min)()
+   static number_type(min)()
    {
       initializer.do_nothing();
       static std::pair<bool, number_type> value;
-      if(!value.first)
+      if (!value.first)
       {
          value.first = true;
          typedef typename boost::mpl::front<typename number_type::backend_type::unsigned_types>::type ui_type;
-         value.second.backend() = ui_type(1u);
+         value.second.backend()            = ui_type(1u);
          value.second.backend().exponent() = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent;
       }
       return value.second;
    }
-   static number_type (max)()
+   static number_type(max)()
    {
       initializer.do_nothing();
       static std::pair<bool, number_type> value;
-      if(!value.first)
+      if (!value.first)
       {
          value.first = true;
-         if(boost::is_void<Allocator>::value)
+         if (boost::is_void<Allocator>::value)
             eval_complement(value.second.backend().bits(), value.second.backend().bits());
          else
          {
-            // We jump through hoops here using the backend type directly just to keep VC12 happy 
+            // We jump through hoops here using the backend type directly just to keep VC12 happy
             // (ie compiler workaround, for very strange compiler bug):
             using boost::multiprecision::default_ops::eval_add;
             using boost::multiprecision::default_ops::eval_decrement;
             using boost::multiprecision::default_ops::eval_left_shift;
-            typedef typename number_type::backend_type::rep_type int_backend_type;
+            typedef typename number_type::backend_type::rep_type                                int_backend_type;
             typedef typename boost::mpl::front<typename int_backend_type::unsigned_types>::type ui_type;
-            int_backend_type i;
+            int_backend_type                                                                    i;
             i = ui_type(1u);
             eval_left_shift(i, boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count - 1);
             int_backend_type j(i);
@@ -1871,25 +1891,25 @@ public:
    {
       return -(max)();
    }
-   BOOST_STATIC_CONSTEXPR int digits = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count;
+   BOOST_STATIC_CONSTEXPR int digits   = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::bit_count;
    BOOST_STATIC_CONSTEXPR int digits10 = (digits - 1) * 301 / 1000;
    // Is this really correct???
-   BOOST_STATIC_CONSTEXPR int max_digits10 = (digits * 301 / 1000) + 3;
-   BOOST_STATIC_CONSTEXPR bool is_signed = true;
-   BOOST_STATIC_CONSTEXPR bool is_integer = false;
-   BOOST_STATIC_CONSTEXPR bool is_exact = false;
-   BOOST_STATIC_CONSTEXPR int radix = 2;
-   static number_type epsilon()
+   BOOST_STATIC_CONSTEXPR int  max_digits10 = (digits * 301 / 1000) + 3;
+   BOOST_STATIC_CONSTEXPR bool is_signed    = true;
+   BOOST_STATIC_CONSTEXPR bool is_integer   = false;
+   BOOST_STATIC_CONSTEXPR bool is_exact     = false;
+   BOOST_STATIC_CONSTEXPR int  radix        = 2;
+   static number_type          epsilon()
    {
       initializer.do_nothing();
       static std::pair<bool, number_type> value;
-      if(!value.first)
+      if (!value.first)
       {
          // We jump through hoops here just to keep VC12 happy (ie compiler workaround, for very strange compiler bug):
          typedef typename boost::mpl::front<typename number_type::backend_type::unsigned_types>::type ui_type;
-         value.first = true;
+         value.first            = true;
          value.second.backend() = ui_type(1u);
-         value.second = ldexp(value.second, 1 - (int)digits);
+         value.second           = ldexp(value.second, 1 - (int)digits);
       }
       return value.second;
    }
@@ -1899,32 +1919,32 @@ public:
       // returns 0.5
       initializer.do_nothing();
       static std::pair<bool, number_type> value;
-      if(!value.first)
+      if (!value.first)
       {
          value.first = true;
          // We jump through hoops here just to keep VC12 happy (ie compiler workaround, for very strange compiler bug):
          typedef typename boost::mpl::front<typename number_type::backend_type::unsigned_types>::type ui_type;
          value.second.backend() = ui_type(1u);
-         value.second = ldexp(value.second, -1);
+         value.second           = ldexp(value.second, -1);
       }
       return value.second;
    }
-   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type min_exponent = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent;
-   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type min_exponent10 = (min_exponent / 1000) * 301L;
-   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type max_exponent = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent;
-   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type max_exponent10 = (max_exponent / 1000) * 301L;
-   BOOST_STATIC_CONSTEXPR bool has_infinity = true;
-   BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = true;
-   BOOST_STATIC_CONSTEXPR bool has_signaling_NaN = false;
-   BOOST_STATIC_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
-   BOOST_STATIC_CONSTEXPR bool has_denorm_loss = false;
-   static number_type infinity()
+   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type min_exponent      = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::min_exponent;
+   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type min_exponent10    = (min_exponent / 1000) * 301L;
+   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type max_exponent      = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::max_exponent;
+   BOOST_STATIC_CONSTEXPR typename boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_type max_exponent10    = (max_exponent / 1000) * 301L;
+   BOOST_STATIC_CONSTEXPR bool                                                                                                             has_infinity      = true;
+   BOOST_STATIC_CONSTEXPR bool                                                                                                             has_quiet_NaN     = true;
+   BOOST_STATIC_CONSTEXPR bool                                                                                                             has_signaling_NaN = false;
+   BOOST_STATIC_CONSTEXPR float_denorm_style has_denorm                                                                                                      = denorm_absent;
+   BOOST_STATIC_CONSTEXPR bool               has_denorm_loss                                                                                                 = false;
+   static number_type                        infinity()
    {
       initializer.do_nothing();
       static std::pair<bool, number_type> value;
-      if(!value.first)
+      if (!value.first)
       {
-         value.first = true;
+         value.first                       = true;
          value.second.backend().exponent() = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_infinity;
       }
       return value.second;
@@ -1933,9 +1953,9 @@ public:
    {
       initializer.do_nothing();
       static std::pair<bool, number_type> value;
-      if(!value.first)
+      if (!value.first)
       {
-         value.first = true;
+         value.first                       = true;
          value.second.backend().exponent() = boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::exponent_nan;
       }
       return value.second;
@@ -1945,13 +1965,14 @@ public:
       return number_type(0);
    }
    BOOST_STATIC_CONSTEXPR number_type denorm_min() { return number_type(0); }
-   BOOST_STATIC_CONSTEXPR bool is_iec559 = false;
-   BOOST_STATIC_CONSTEXPR bool is_bounded = true;
-   BOOST_STATIC_CONSTEXPR bool is_modulo = false;
-   BOOST_STATIC_CONSTEXPR bool traps = true;
-   BOOST_STATIC_CONSTEXPR bool tinyness_before = false;
+   BOOST_STATIC_CONSTEXPR bool        is_iec559         = false;
+   BOOST_STATIC_CONSTEXPR bool        is_bounded        = true;
+   BOOST_STATIC_CONSTEXPR bool        is_modulo         = false;
+   BOOST_STATIC_CONSTEXPR bool        traps             = true;
+   BOOST_STATIC_CONSTEXPR bool        tinyness_before   = false;
    BOOST_STATIC_CONSTEXPR float_round_style round_style = round_to_nearest;
-private:
+
+ private:
    struct data_initializer
    {
       data_initializer()
@@ -1963,12 +1984,12 @@ private:
          std::numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::infinity();
          std::numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> > >::quiet_NaN();
       }
-      void do_nothing()const{}
+      void do_nothing() const {}
    };
    static const data_initializer initializer;
 };
 
-template<unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
+template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
 const typename numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >::data_initializer numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >::initializer;
 
 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION