Macaulay2 / Macaulay2/M2

Polynomial division over RR and CC

Open
#2,786 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Engine
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Currently, when trying to divide polynomials with coefficients in an inexact field, an error is raised:

```m2
i1 : R = CC[x]

o1 = R

o1 : PolynomialRing

i2 : quotientRemainder(x^2 + 2, x - ii)
stdio:2:1:(3): error: polynomial division not yet implemented for RR or CC coefficients
```

However, commenting out the following lines seems to make things work just fine:
https://github.com/Macaulay2/M2/blob/048c777dc703365e44c3865b2c1faed698b82b3a/M2/Macaulay2/e/poly.cpp#L1162-L1166

For example:
```m2
i1 : R = CC[x]

o1 = R

o1 : PolynomialRing

i2 : quotientRemainder(x^2 + 2, x - ii)

o2 = (x + ii, 1)

o2 : Sequence
```
Is there a reason we're raising an error?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with M2/Macaulay2/e/poly.cpp at lines 1162-1166 and reproduce the shown quotientRemainder example for CC[x]. Determine why polynomial division is rejected for RR and CC, then verify that quotientRemainder produces the expected result for inexact-field coefficients without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.