Boost C++ Libraries: Ticket #13301: boost multiprecision conversion from binary float to int types fails for large floats https://svn.boost.org/trac10/ticket/13301 <p> It appears the conversion from binary float types such as </p> <pre class="wiki">typedef number&lt;cpp_bin_float&lt;8,backends::digit_base_2&gt; &gt; quarter_float; </pre><p> to integer types fails if the float is 2<sup>8</sup> or larger. For example, using </p> <pre class="wiki">quarter_float qf(256); cpp_int i = qf.convert_to&lt;cpp_int&gt;(); unsigned int n = qf.convert_to&lt;unsigned int&gt;(); </pre><p> I get 0 for i and 4294967295 for n. </p> <p> A try to attach a full code example. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13301 Trac 1.4.3 marc.alexa@… Sat, 18 Nov 2017 07:16:06 GMT attachment set https://svn.boost.org/trac10/ticket/13301 https://svn.boost.org/trac10/ticket/13301 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bmc.cc</span> </li> </ul> Ticket John Maddock Mon, 25 Dec 2017 16:25:10 GMT <link>https://svn.boost.org/trac10/ticket/13301#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13301#comment:1</guid> <description> <p> Confirmed, investigating, thanks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 27 Dec 2017 18:28:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13301#comment:2 https://svn.boost.org/trac10/ticket/13301#comment:2 <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">fixed</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/a4b198e1b79e735825e15e6bf6572b86e7b8dd3c"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/a4b198e1b79e735825e15e6bf6572b86e7b8dd3c</a> </p> <p> Thanks for the report. </p> Ticket