[GiNaC-devel] Re: content() inconsistencies

Christian Bauer Christian.Bauer at uni-mainz.de
Mon Aug 2 18:37:03 CEST 2004


Hi!

On Fri, Jul 02, 2004 at 05:24:48PM +0200, Ralf Stephan wrote:
> While going through the loop computing the gcd of the coeff numerators,
> one would simultaneously collect the lcm of the denominators, numeric
> or otherwise, with the end result gcd divided by lcm.
> 
> I'm quite satisfied with the following patch. YMMV.

I've implemented this a little differently now, by putting the LCM stuff
into integer_content() (which behaved a little inconsistently before,
anyway: integer_content(x/2) already returned 1/2).

This should work with all polynomials with rational coefficients. It does
not work for non-polynomials like x/a+1. For these you have to pipe it
through numer_denom() to separate the denominator manually.

Bye,
Christian

-- 
  / Physics is an algorithm
\/ http://www.uni-mainz.de/~bauec002/



More information about the GiNaC-devel mailing list