On Nov 19, 9:44 pm, Rolandb <rola...@planet.nl> wrote:
> Hi. Look at:
>
> R.<A,B>=QQ[]
> expr=(A,B)
> (a,b)=sorted([abs(expr[n]([2,16])) for n in [0,1]])
> print a,b,a.gcd(b)
>
> I got: 2 16 1
> I expected: 2 16 2
>
> Reason?

Because a and b are rational numbers here: they're elements of QQ.
Type

a.gcd?

and hit return; it explains it in the docstring.  If you want a gcd of
2, start off with

sage: R.<A,B> = ZZ[]

--
John

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to