Subject: [Boost-bugs] [Boost C++ Libraries] #8133: multiprecision, failed gcd tests (test_cpp_int.cpp)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-21 00:08:38
#8133: multiprecision, failed gcd tests (test_cpp_int.cpp)
--------------------------------------------------+-------------------------
Reporter: Stepan Podoskin <stepik-777@â¦> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.53.0 | Severity: Problem
Keywords: |
--------------------------------------------------+-------------------------
I modified test_cpp_int.cpp to generate random numbers with a lot of ones
or zeros.
I modified '''T generate_random(unsigned bits_wanted)''':
{{{
...
T val = 0;
for(unsigned i = 0; i < terms_needed; ++i)
{
val *= (gen.max)();
switch (gen() % 5)
{
case 0:
val += gen();
break;
case 1:
val += 1;
break;
case 2:
val += (gen.max)() - 2;
break;
case 3:
val += (gen.max)() - 1;
break;
}
}
val %= max_val;
return (val == 0)? val : 1;
}
}}}
This caused some tests related to gcd computation to fail. Here is output
(I removed some parts of it with results of operations) -
http://pastebin.com/iZdmX1bq
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8133> 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