Boost C++ Libraries: Ticket #10363: Used unsigned long pieces for GMP _ui functions https://svn.boost.org/trac10/ticket/10363 <p> Hello, </p> <p> looking for something else, I was surprised to notice that, when it gets an 'unsigned long long', boost splits it in pieces of type 'unsigned' to pass them to GMP functions, when it could use bigger 'unsigned long' pieces for better performance. When long and long long have the same size, it would avoid any splitting. </p> <p> Also, I believe using &lt;&lt; or &gt;&gt; with numeric_limits&lt;unsigned&gt;::digits is undefined behavior if int and long long have the same size (maybe that's why you didn't use long, because there are much fewer platforms where int and long long have the same size). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10363 Trac 1.4.3 John Maddock Mon, 30 Mar 2015 08:46:56 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10363#comment:1 https://svn.boost.org/trac10/ticket/10363#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">fixed</span> </li> </ul> <p> Thanks, you're quite right on all counts, fixed in <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/3719752df50e2b93a2eb7ad1784641fd8922eb97"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/3719752df50e2b93a2eb7ad1784641fd8922eb97</a>. </p> <p> Also quashed GCC warnings when using long long in -ansi mode: <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/0de03d129db4ac71e593c5243d953fa0df83a04c"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/0de03d129db4ac71e593c5243d953fa0df83a04c</a> </p> Ticket