Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8423: miller_rabin_test core dump
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-10 07:19:51
#8423: miller_rabin_test core dump
---------------------------------+------------------------------------------
Reporter: robbieye@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords: miller rabin primality
---------------------------------+------------------------------------------
Comment (by anonymous):
Here's the properly formatted code. Please ignore the malformed snippet
above.
{{{
#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/miller_rabin.hpp>
#include <boost/multiprecision/random.hpp>
namespace mp = boost::multiprecision;
typedef mp::cpp_int BIGNUM;
int
main(int argc, char* argv[])
{
// Test primality for 2^(2^5) + 1
BIGNUM num = (BIGNUM(1) << (1u << 5)) + 1;
boost::random::mt19937 prng(clock());
std::cout << "Running primality test for : " << num;
bool isPrime = mp::miller_rabin_test(num, 25, prng);
std::cout << ", result : "
<< (isPrime ? "" : "not ")
<< "prime."
<< std::endl;
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8423#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC