* Fix signed/unsigned bug in bernoulli function.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sun, 18 Dec 2005 23:36:36 +0000 (23:36 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sun, 18 Dec 2005 23:36:36 +0000 (23:36 +0000)
ginac/numeric.cpp

index f62b0d2..8825bdb 100644 (file)
@@ -1708,7 +1708,7 @@ const numeric bernoulli(const numeric &nn)
        results.reserve(n/2);
        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(1-p)/2;
+               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;