Chris@16: /////////////////////////////////////////////////////////////// Chris@16: // Copyright 2012 John Maddock. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_ Chris@16: Chris@16: #ifndef BOOST_MP_DIGITS_HPP Chris@16: #define BOOST_MP_DIGITS_HPP Chris@16: Chris@16: namespace boost{ namespace multiprecision{ namespace detail{ Chris@16: Chris@16: inline unsigned long digits10_2_2(unsigned long d10) Chris@16: { Chris@16: return (d10 * 1000uL) / 301uL + ((d10 * 1000uL) % 301 ? 2u : 1u); Chris@16: } Chris@16: Chris@16: inline unsigned long digits2_2_10(unsigned long d2) Chris@16: { Chris@16: return (d2 * 301uL) / 1000uL; Chris@16: } Chris@16: Chris@16: }}} // namespaces Chris@16: Chris@16: #endif