/*
Copyright (C) 2010 Fredrik Johansson
Copyright (C) 2010 William Hart
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See .
*/
#include "arith.h"
#if FLINT64
#define LARGEST_ULONG_PRIMORIAL 52
#else
#define LARGEST_ULONG_PRIMORIAL 28
#endif
/* Only those with odd index */
const ulong ULONG_PRIMORIALS[] =
{
UWORD(6),
UWORD(30),
UWORD(210),
UWORD(210),
UWORD(2310),
UWORD(30030),
UWORD(30030),
UWORD(510510),
UWORD(9699690),
UWORD(9699690),
UWORD(223092870),
UWORD(223092870),
UWORD(223092870),
#if FLINT64
UWORD(6469693230),
UWORD(200560490130),
UWORD(200560490130),
UWORD(200560490130),
UWORD(7420738134810),
UWORD(7420738134810),
UWORD(304250263527210),
UWORD(13082761331670030),
UWORD(13082761331670030),
UWORD(614889782588491410),
UWORD(614889782588491410),
UWORD(614889782588491410)
#endif
};
#define PROD_LIMBS_DIRECT_CUTOFF 50
mp_size_t mpn_prod_limbs_direct(mp_limb_t * result, const mp_limb_t * factors,
mp_size_t n)
{
mp_size_t k, len;
mp_limb_t top;
if (n < 1)
{
result[0] = UWORD(1);
return 1;
}
result[0] = factors[0];
len = 1;
for (k=1; k_mp_d, primes, pi, bits);
mpz_ptr->_mp_size = len;
}