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

Add check for zero monomial in monomial_coefficient #39256

Merged
merged 2 commits into from
Mar 9, 2025

Conversation

keltecc
Copy link
Contributor

@keltecc keltecc commented Jan 3, 2025

Fixes #39255

Added check for zero monomial and corresponding test case.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Jan 4, 2025

Documentation preview for this PR (built with commit 9230780; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@keltecc keltecc force-pushed the fix-monomial-coefficient branch from 27f754a to d0fe6f3 Compare January 10, 2025 11:45
@fchapoton
Copy link
Contributor

does it work with "is NULL" ?

there is no final dot at the end of error messages (it's a Python general convention)

@keltecc
Copy link
Contributor Author

keltecc commented Jan 17, 2025

Thank you for review, fixed.

does it work with "is NULL" ?

It works.

there is no final dot at the end of error messages (it's a Python general convention)

I tried to keep consistency with another error message in this function:

        if mon._parent is not self._parent:
            raise TypeError("mon must have same parent as self.")

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Positive review.

vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 9, 2025
sagemathgh-39256: Add check for zero monomial in monomial_coefficient
    
Fixes sagemath#39255

Added check for zero monomial and corresponding test case.



### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39256
Reported by: Vladimir
Reviewer(s): Travis Scrimshaw
@vbraun vbraun merged commit e5cb9ec into sagemath:develop Mar 9, 2025
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault in monomial_coefficient
4 participants