#19171: Add a method `divides` to Polynomial
-------------------------------------+-------------------------------------
Reporter: bruno | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.3
Component: commutative | Resolution:
algebra |
Keywords: polynomial, | Merged in:
division |
Authors: Bruno Grenet | Reviewers: Vincent Delecroix
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/bruno/t19171_divides_poly | 0906dfd9801e14acab59d28999fe1778d3cc018d
Dependencies: #16649 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by bruno):
* status: needs_work => needs_review
Comment:
Replying to [comment:16 vdelecroix]:
> {{{...}}}
> I meant
> `...`
Done.
> >
> > > And why not using {{{quo_rem}}} instead of catching a potential
{{{ArithmeticError}}}?
> >
> > Using {{{p % self}}} is really the same as {{{ p.quo_rem(self)[1] }}}
so I do not see the difference.
>
> Not exactly. NTL makes a distinction... and you should actually use
`pseudo_quo_rem` when it is there:
> {{{
> sage: R.<x> = PolynomialRing(ZZ, implementation="NTL")
> sage: p = 2*x + 1
> sage: q = R.random_element(10)
> sage: p.quo_rem(q)
> Traceback (most recent call last):
> ...
> ArithmeticError: division not exact in Z[x] (consider coercing to Q[x]
first)
> sage: p.pseudo_quo_rem(q)
> (0, 2*x + 1)
> }}}
Not done: I do not think `pseudo_quo_rem` is applicable, because of the
following:
{{{#!python
sage: R.<x> = ZZ[] # works the same with NTL
sage: p = x^2 - 1
sage: q = 2*x + 2
sage: p.pseudo_quo_rem(q)
(2*x - 2, 0)
}}}
So, the remainder in `p.pseudo_quo_rem(q)` can be zero even if `q` does
not divide `p`.
P.S.: I won't be able to work on this ticket until mid-august.
--
Ticket URL: <https://trac.sagemath.org/ticket/19171#comment:18>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.