From 11927b0eacfea55a57f477549e6dd7a7dab20716 Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Mon, 1 Dec 2003 23:02:16 +0000 Subject: [PATCH] Fixed severe bug that caused Li and S to hang for certain parameters --- ginac/inifcns_nstdsums.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ginac/inifcns_nstdsums.cpp b/ginac/inifcns_nstdsums.cpp index 4b8122d2..5cc4c7ce 100644 --- a/ginac/inifcns_nstdsums.cpp +++ b/ginac/inifcns_nstdsums.cpp @@ -189,7 +189,7 @@ cln::cl_N Li2_do_sum(const cln::cl_N& x) { cln::cl_N res = x; cln::cl_N resbuf; - cln::cl_N num = x; + cln::cl_N num = x * cln::cl_float(1, cln::float_format(Digits)); cln::cl_I den = 1; // n^2 = 1 unsigned i = 3; do { @@ -208,7 +208,7 @@ cln::cl_N Li2_do_sum_Xn(const cln::cl_N& x) { std::vector::const_iterator it = Xn[0].begin(); cln::cl_N u = -cln::log(1-x); - cln::cl_N factor = u; + cln::cl_N factor = u * cln::cl_float(1, cln::float_format(Digits)); cln::cl_N res = u - u*u/4; cln::cl_N resbuf; unsigned i = 1; @@ -226,7 +226,7 @@ cln::cl_N Li2_do_sum_Xn(const cln::cl_N& x) // calculates Li(n,x), n>2 without Xn cln::cl_N Lin_do_sum(int n, const cln::cl_N& x) { - cln::cl_N factor = x; + cln::cl_N factor = x * cln::cl_float(1, cln::float_format(Digits)); cln::cl_N res = x; cln::cl_N resbuf; int i=2; @@ -245,7 +245,7 @@ cln::cl_N Lin_do_sum_Xn(int n, const cln::cl_N& x) { std::vector::const_iterator it = Xn[n-2].begin(); cln::cl_N u = -cln::log(1-x); - cln::cl_N factor = u; + cln::cl_N factor = u * cln::cl_float(1, cln::float_format(Digits)); cln::cl_N res = u; cln::cl_N resbuf; unsigned i=2; @@ -846,7 +846,9 @@ cln::cl_N S_do_sum(int n, int p, const cln::cl_N& x, const cln::float_format_t& } // should be done otherwise - cln::cl_N xf = x * cln::cl_float(1, prec); + cln::cl_F one = cln::cl_float(1, cln::float_format(Digits)); + cln::cl_N xf = x * one; + //cln::cl_N xf = x * cln::cl_float(1, prec); cln::cl_N res; cln::cl_N resbuf; -- 2.44.0