gcd() and lcm()

Alessandro Zaccagnini zaccagni at prmat.math.unipr.it
Mon Sep 16 15:38:46 CEST 2002


Dear all,

we just tried to use the functions gcd() and lcm() and we found
something strange.

>gcd(2*x+1, x+1/2);
1
>gcd(2*x+1, 4*x+2);
1+2*x

The documentation (section 5.5.5 of GiNaC 1.0.10) says that gcd()
accepts two expressions, without specifying their type. In the last
sentence, it talks about polynomials, again, without specifying whether
they are integer polynomials or they are allowed to have rational
coefficients. Since we need the functions gcd() and lcm() very often, we
would like to know as precisely as possible what is the intended
behaviour. Thank you very much

Alessandro Zaccagnini and Tatiana Zolo



More information about the GiNaC-list mailing list