[sympy] why does terms_gcd clear the denominators of an expression

2011-05-27 Thread smichr
There are two questions, really: 1) why does gcd(2/3, 4/9) give 2/9 instead of (the greater) 2/3? I know what the code is doing...but should it be doing that? I read that > This definition is consistent with the idea that `a / gcd(a,x)' should yield > an integer for any `a' and `x'. But why s

Re: [sympy] why does terms_gcd clear the denominators of an expression

2011-05-27 Thread Aaron S. Meurer
Shouldn't it return 1? Aaron Meurer On May 27, 2011, at 3:14 PM, smichr wrote: > There are two questions, really: > > 1) why does gcd(2/3, 4/9) give 2/9 instead of (the greater) 2/3? I > know what the code is doing...but should it be doing that? I read > that > >> This definition is consistent

Re: [sympy] why does terms_gcd clear the denominators of an expression

2011-05-27 Thread Chris Smith
Aaron S. Meurer wrote: >> Shouldn't it return 1? The quote I posted takes the approach that the divisor is the number that divides both and still gives an integer, so our gcd and current primitive method (soon to be changed) is consistent with that notion. >>> R=Rational;gcd(R(2,3),R(4,9))

Re: [sympy] why does terms_gcd clear the denominators of an expression

2011-05-31 Thread Mateusz Paprocki
Hi, On 27 May 2011 21:08, Chris Smith wrote: > Aaron S. Meurer wrote: > >> Shouldn't it return 1? > > The quote I posted takes the approach that the divisor is the number that > divides both and still gives an integer, so our gcd and current primitive > method (soon to be changed) is consistent