[poincare] Don't make Integer::k_primorial32 a global variable

This commit is contained in:
Romain Goyet
2018-04-10 15:03:42 +02:00
parent c090e2aa13
commit 7de609028c
2 changed files with 2 additions and 4 deletions

View File

@@ -13,7 +13,6 @@ public:
static void PrimeFactorization(const Integer * i, Integer * outputFactors, Integer * outputCoefficients, int outputLength);
constexpr static int k_numberOfPrimeFactors = 1000;
constexpr static int k_maxNumberOfPrimeFactors = 32;
static const Integer k_primorial32;
private:
/* When decomposing an integer into primes factors, we look for its prime
* factors among integer from 2 to 10000. */

View File

@@ -3,8 +3,6 @@
namespace Poincare {
const Integer Arithmetic::k_primorial32("525896479052627740771371797072411912900610967452630");
Integer Arithmetic::LCM(const Integer * a, const Integer * b) {
if (a->isZero() || b->isZero()) {
return Integer(0);
@@ -47,7 +45,8 @@ void Arithmetic::PrimeFactorization(const Integer * n, Integer * outputFactors,
if (m.isEqualTo(Integer(1))) {
return;
}
if (k_primorial32.isLowerThan(m)) {
const Integer primorial32("525896479052627740771371797072411912900610967452630");
if (primorial32.isLowerThan(m)) {
/* Special case 1: We do not want to break i in prime factor because it
* might take too many factors... More than k_maxNumberOfPrimeFactors.
* outputCoefficients[0] is set to -1 to indicate a special case. */