#16721: symbolic gcd()
-----------------------------+------------------------
       Reporter:  rws        |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-6.3
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:  todo
-----------------------------+------------------------

Comment (by kcrisman):

 {{{

         <type 'sage.rings.integer.Integer'>

     TESTS:

     The following shows that indeed coercion takes place before computing
     the gcd. This behaviour was introduced in trac ticket #10771::

         sage: R.<x>=QQ[]
         sage: S.<x>=ZZ[]
         sage: p = S.random_element()
         sage: q = R.random_element()
         sage: parent(gcd(1/p,q))
         Fraction Field of Univariate Polynomial Ring in x over Rational
 Field
         sage: parent(gcd([1/p,q]))
         Fraction Field of Univariate Polynomial Ring in x over Rational
 Field
 }}}
 and indeed
 {{{
 sage: parent(gcd(x,1))
 Symbolic Ring
 }}}
 So in the symbolic ring this IS the gcd.  Hmm.  And if you think of this
 as a polynomial, it makes sense.

 So I'm not sure what to say here.  The `4` might be a red herring in this
 case, because we consider `SR` or whatever as more about polynomials over
 a field, so the gcd is automatically one - maybe?  Also check out
 `x.gcd??`.  Just raising questions about what the "right" thing to do is.
 {{{

     Make sure we try QQ and not merely ZZ (:trac:`13014`)::

         sage: bool(gcd(2/5, 3/7) == gcd(SR(2/5), SR(3/7)))
         True
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16721#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to