Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolynomialRealDense.quo_rem() returns zero polynomials with wrong degree #18467

Closed
pjbruin opened this issue May 21, 2015 · 8 comments
Closed

Comments

@pjbruin
Copy link
Contributor

pjbruin commented May 21, 2015

In Sage 6.7, the following is correct:

sage: R.<x> = QQ[]
sage: z = R.zero()
sage: z.degree()
-1
sage: q, r = z.quo_rem(x)
sage: q.degree()
-1

The following (QQ -> RR) is not:

sage: S.<x> = RR[]
sage: z = S.zero()
sage: z.degree()
-1
sage: q, r = z.quo_rem(x)
sage: q.degree()
-2

The last result should be -1; the given answer implies for example

sage: q == z
False

which is nonsense since q and z are both the zero polynomial.

Component: basic arithmetic

Keywords: polynomial degree quo_rem

Author: Peter Bruin

Branch/Commit: 9dc90cc

Reviewer: Bruno Grenet

Issue created by migration from https://trac.sagemath.org/ticket/18467

@pjbruin pjbruin added this to the sage-6.8 milestone May 21, 2015
@pjbruin
Copy link
Contributor Author

pjbruin commented May 27, 2015

Branch: u/pbruin/18467-quo_rem

@pjbruin
Copy link
Contributor Author

pjbruin commented May 27, 2015

Author: Peter Bruin

@pjbruin
Copy link
Contributor Author

pjbruin commented May 27, 2015

Commit: 9dc90cc

@bgrenet
Copy link

bgrenet commented May 27, 2015

comment:2

Looks fine to me! A minor comment: It seems that people prefer not referring to `self` in the documentation, so you could replace the documentation of this function by

Return the quotient with remainder of this polynomial by ``other``.

@bgrenet
Copy link

bgrenet commented May 27, 2015

Reviewer: Bruno Grenet

@pjbruin
Copy link
Contributor Author

pjbruin commented May 27, 2015

comment:3

Replying to @bgrenet:

Looks fine to me! A minor comment: It seems that people prefer not referring to `self` in the documentation

If you really insist I can change it, but I personally prefer self over this polynomial (see #13442 comment:5).

There was some recent discussion on a related question, namely whether self should be documented in INPUT sections of methods. On that question I agree with most people that it should not.

@bgrenet
Copy link

bgrenet commented May 27, 2015

comment:4

Replying to @pjbruin:

Replying to @bgrenet:

Looks fine to me! A minor comment: It seems that people prefer not referring to `self` in the documentation

If you really insist I can change it, but I personally prefer self over this polynomial (see #13442 comment:5).

There was some recent discussion on a related question, namely whether self should be documented in INPUT sections of methods. On that question I agree with most people that it should not.

Actually, I was referring to (the beginning of) this discussion. Yet there does not seem to be a consensus. And I do not have a strong opinion on this... so I do not insist!

@vbraun
Copy link
Member

vbraun commented May 27, 2015

Changed branch from u/pbruin/18467-quo_rem to 9dc90cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants