#4000: [with patch, needs work] Implement QQ['x'] via Flint ZZ['x'] +
denominator
------------------------------+---------------------------------------------
Reporter: malb | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: basic arithmetic | Keywords:
Reviewer: | Author: Martin Albrecht
Merged: |
------------------------------+---------------------------------------------
Comment(by spancratz):
Replying to [comment:19 malb]:
> Replying to [comment:17 spancratz]:
> I think we should have {{{gcd(a,0) = 1}}} because this is what
{{{gcd(1/2,0)}}} returns. I would like to avoid to put this logic in the
celement_gcd implementations but if we have to then ... well we have to :)
I didn't mean the above for rational numbers ``a``, but for rational
polynomials ``a``. Your integer example above highlights that ``gcd``
doesn't necessarily guarantee ``gcd(a, 0) == a``. The behaviour of
``gcd`` for integers suggests the method should return the monic
normalisation. However, the current logic in ``template_polynomial.pxi``
doesn't do this, for example:
{{{
sage: R.<t> = PolynomialRing(IntegerModRing(3), 't')
sage: f = 2*t + 1
sage: type(f)
<type
'sage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint'>
sage: gcd(f, R(0))
2*t + 1
}}}
In the above case, the monic version would be ``t + 2``.
> This might be worth raising on [sage-devel] where people care much more
about this than I do, i.e. I guess it is a relevant corner case for number
theory and thus people might have strong feelings about it?
OK, I'll do this.
Sebastian
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4000#comment:21>
Sage <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---