Boost C++ Libraries: Ticket #11165: using cpp_int and other integer types gives unknown type name 'cpp_int' error when compiled on Xcode 6 on a macbook. https://svn.boost.org/trac10/ticket/11165 <p> #include &lt;iostream&gt; #include &lt;/Users/yavuz/boost_1_57_0/boost/multiprecision/cpp_int.hpp&gt; </p> <p> int main(int argc, const char * argv[]) { using namespace boost::multiprecision; cpp_int factorial = 1; return 0; } </p> <p> BTW, since boost installation doesn't specify where boost should be installed, I installed it in my home directory and that led me to writing out the path to it in the include directive. Otherwise, include gives an error message. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11165 Trac 1.4.3 Steven Watanabe Fri, 03 Apr 2015 19:33:43 GMT <link>https://svn.boost.org/trac10/ticket/11165#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:1</guid> <description> <p> You need to add /Users/yavuz/boost_1_57_0 to the include directories instead of passing the full path. The command line option is -I. I don't know where you configure this in XCode. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 03 Apr 2015 19:47:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11165#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11165#comment:1" title="Comment 1">steven_watanabe</a>: </p> <blockquote class="citation"> <p> You need to add /Users/yavuz/boost_1_57_0 to the include directories instead of passing the full path. The command line option is -I. I don't know where you configure this in XCode. </p> </blockquote> <p> Thank you. I fixed this by including a path in the user search options on Xcode. I have another question. I receive an error when I execute the following assignment statement: </p> <p> cpp_int f=123456789123456789123; </p> <p> If I remove 3 at the end, it shows a warning, and when I also remove 2, it works fine. This same error occurs with uint256_t and uint256_t as well. The number of digits is about 21 and I would think that all three multi precision types should be fine with it, but they all result in an error message. Any explanation? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 03 Apr 2015 20:46:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11165#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:3</guid> <description> <p> 123456789123456789123 is not a cpp_int. It's a built in integer literal. You can use the string constructor for larger values. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 03 Apr 2015 21:40:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11165#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11165#comment:3" title="Comment 3">steven_watanabe</a>: </p> <blockquote class="citation"> <p> 123456789123456789123 is not a cpp_int. It's a built in integer literal. You can use the string constructor for larger values. </p> </blockquote> <p> That makes sense. The reason I had brought it up was I have run into a problem with the following declaration: uint128_t M<a class="changeset" href="https://svn.boost.org/trac10/changeset/1000" title="(1) assignable added to BoundedTypes requirements. (2) slight ...">[1000]</a><a class="changeset" href="https://svn.boost.org/trac10/changeset/1000" title="(1) assignable added to BoundedTypes requirements. (2) slight ...">[1000]</a>; I am doing simple additions on pairs of values in this matrix. Can you please confirm that this will create a 1000 by 1000 matrix where each element is a 128-bit integer? And also, will my additions be performed with results represented as uint128_t numbers? Thank you. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 03 Apr 2015 21:54:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11165#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11165#comment:4" title="Comment 4">anonymous</a>: </p> <blockquote class="citation"> <p> That makes sense. The reason I had brought it up was I have run into a problem with the following declaration: uint128_t M<a class="changeset" href="https://svn.boost.org/trac10/changeset/1000" title="(1) assignable added to BoundedTypes requirements. (2) slight ...">[1000]</a><a class="changeset" href="https://svn.boost.org/trac10/changeset/1000" title="(1) assignable added to BoundedTypes requirements. (2) slight ...">[1000]</a>; I am doing simple additions on pairs of values in this matrix. Can you please confirm that this will create a 1000 by 1000 matrix where each element is a 128-bit integer? </p> </blockquote> <p> Yes. </p> <blockquote class="citation"> <p> And also, will my additions be performed with results represented as uint128_t numbers? Thank you. </p> </blockquote> <p> I assume that your additions are of the form (M[i][j] + M[k][l]). I think you are correct, but the result might also be an expression template type. You'll have to check the documentation. In any case, the result of the addition will be convertible to uint128_t. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 03 Apr 2015 21:55:37 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/11165#comment:6 https://svn.boost.org/trac10/ticket/11165#comment:6 <ul> <li><strong>owner</strong> set to <span class="trac-author">John Maddock</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">multiprecision</span> </li> </ul> Ticket anonymous Fri, 03 Apr 2015 22:37:49 GMT <link>https://svn.boost.org/trac10/ticket/11165#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11165#comment:6" title="Comment 6">steven_watanabe</a>: </p> <p> Thank you. Actually, the additions work when the matrix row (column) dimension is capped around 700. It is not so much the matrix size, but the numbers I compute get to be 21 or 22 decimal digit big when the matrix row (column) dimension gets to be about 710. I suspect that the additions are capped at 64-bits because 64 bits roughly correspond to 21-22 decimal digits. So, it seems that uint128_t does not seem to be working as intended. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 04 Apr 2015 08:00:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11165#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11165#comment:8</guid> <description> <p> I think you need to post a test case if you want us to investigate that further. One simple thing you can try first is to replace uint128_t with checked_uint128_t, and if it throws an exception somewhere then you know you have numeric overflow in the calculation. </p> <p> With respect to one of your earlier questions, large numeric literals are possible in C++11 mode, see: <a href="http://www.boost.org/doc/libs/1_57_0/libs/multiprecision/doc/html/boost_multiprecision/tut/lits.html">http://www.boost.org/doc/libs/1_57_0/libs/multiprecision/doc/html/boost_multiprecision/tut/lits.html</a> </p> <p> And finally.... note that GCC (though not other compilers) has a built-in <code>__int128</code> type which will be a little faster than <code>boost::multiprecision::uint128_t</code> (uint128_t will actually be a thin wrapper around <code>unsigned __int128</code> on GCC). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 08 May 2015 11:56:59 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11165#comment:9 https://svn.boost.org/trac10/ticket/11165#comment:9 <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">worksforme</span> </li> </ul> Ticket