Opened 7 years ago

Closed 7 years ago

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

Reported by: Owned by: pbruin major sage-6.8 basic arithmetic polynomial degree quo_rem Peter Bruin Bruno Grenet N/A 9dc90cc 9dc90cc9367a016745c85326d7a8abfabe2e3d53

### Description

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.

### comment:1 Changed 7 years ago by pbruin

• Authors set to Peter Bruin
• Branch set to u/pbruin/18467-quo_rem
• Commit set to 9dc90cc9367a016745c85326d7a8abfabe2e3d53
• Status changed from new to needs_review

### comment:2 follow-up: ↓ 3 Changed 7 years ago by bruno

• Reviewers set to Bruno Grenet

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``.
```

### comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 7 years ago by pbruin

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 comment:5:ticket:13442).

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.

### comment:4 in reply to: ↑ 3 Changed 7 years ago by bruno

• Status changed from needs_review to positive_review

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 comment:5:ticket:13442).

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!

### comment:5 Changed 7 years ago by vbraun

• Branch changed from u/pbruin/18467-quo_rem to 9dc90cc9367a016745c85326d7a8abfabe2e3d53
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.