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

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