commit e989719ca767691eb75b34785baaaed716ea2624 Author: Jens Vollinga <jensv@balin.nikhef.nl> Date: Mon Nov 3 15:50:31 2008 +0100
Added code for distinct degree factorization.
Thanks to stupid^W standard floating-integral conversions it fails to compile: [snipped]
I've "fixed" it in the following way: diff --git a/ginac/factor.cpp b/ginac/factor.cpp index 19549a2..8ca39c3 100644 --- a/ginac/factor.cpp +++ b/ginac/factor.cpp @@ -900,7 +900,8 @@ static void distinct_degree_factor_BSGS(const umodpoly& a, upvec& result) int m = std::ceil(((double)n)/2/l); upvec H(m); - int ql = std::pow(q, l); + // XXX: what happens if we have an overflow here? + int ql = cl_I_to_int(expt_pos(cl_I(q), l)); H[0] = h[l]; for ( int i=1; i<m; ++i ) { expt_pos(H[i-1], ql, qk); Best regards, Alexei -- All science is either physics or stamp collecting.