Skip to content

Conversation

@Hapsa21
Copy link
Contributor

@Hapsa21 Hapsa21 commented Nov 28, 2025

Description

Previously, calling .radical() on 0 (e.g., Integer(0).radical()) raised an ArithmeticError because the Integer class lacked its own implementation, falling back to a generic method that attempted to factor zero.

This PR adds a dedicated radical() method to sage.rings.integer.Integer that:

  1. Explicitly returns 0 when called on 0.
  2. Delegates to self.factor().radical_value() for all other integers, preserving existing behavior.

Fixes

#41222

@Hapsa21
Copy link
Contributor Author

Hapsa21 commented Dec 7, 2025

@user202729 Is this solution fine?

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant