X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fnumeric.cpp;h=965368625a9343dfe59ee2f82aa7803f66561a55;hp=9f7968ea0d4d5167b6cf5052a6ec0fe3428c529a;hb=4f87021ee5736f9bd9571dfbe455cf02a380c7d2;hpb=48ac2cd6f4e3dbd2781e0e66df6462a1f451a1de diff --git a/ginac/numeric.cpp b/ginac/numeric.cpp index 9f7968ea..96536862 100644 --- a/ginac/numeric.cpp +++ b/ginac/numeric.cpp @@ -1709,19 +1709,19 @@ const numeric bernoulli(const numeric &nn) for (unsigned p=next_r; p<=n; p+=2) { cln::cl_I c = 1; // seed for binonmial coefficients cln::cl_RA b = cln::cl_RA(p-1)/-2; - const unsigned p3 = p+3; - const unsigned pm = p-2; - unsigned i, k, p_2; - // test if intermediate unsigned int can be represented by immediate - // objects by CLN (i.e. < 2^29 for 32 Bit machines, see ) + // The CLN manual says: "The conversion from `unsigned int' works only + // if the argument is < 2^29" (This is for 32 Bit machines. More + // generally, cl_value_len is the limiting exponent of 2. We must make + // sure that no intermediates are created which exceed this value. The + // largest intermediate is (p+3-2*k)*(p/2-k+1) <= (p^2+p)/2. if (p < (1UL<