Boost C++ Libraries: Ticket #8996: Boost.Multiprecision - implicit conversion of reminder to divisor type. https://svn.boost.org/trac10/ticket/8996 <pre class="wiki">#include &lt;boost/multiprecision/cpp_int.hpp&gt; #include &lt;cstdint&gt; void test() { typedef boost::multiprecision::cpp_int Num; typedef std::uint32_t Div; Num n(123); Div d(13); //Div r = n % d; // error: no implicit conversion Num rn = n % d; // this works... Div r = rn.convert_to&lt; Div &gt;(); // but explicit conversion is required } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8996 Trac 1.4.3 John Maddock Thu, 15 Aug 2013 10:13:38 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8996#comment:1 https://svn.boost.org/trac10/ticket/8996#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> This is what the integer modulus function is for <a href="http://www.boost.org/doc/libs/1_54_0/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html#boost_multiprecision.ref.number.integer_functions">http://www.boost.org/doc/libs/1_54_0/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html#boost_multiprecision.ref.number.integer_functions</a> </p> <pre class="wiki">#include &lt;boost/multiprecision/cpp_int.hpp&gt; #include &lt;cstdint&gt; void test() { typedef boost::multiprecision::cpp_int Num; typedef std::uint32_t Div; Num n(123); Div d(13); Div r = integer_modulus(n, d); } </pre> Ticket