Skip to content

Conversation

viktorking7
Copy link

Description:

  • Summary: Align polynomial division APIs to return None on zero divisor instead of panicking.
  • Motivation: Prevent unexpected process crashes and make behavior consistent with Option-returning signatures.
  • Changes:
    • poly/src/polynomial/univariate/mod.rs:
      • naive_div: panic! → return None when divisor is zero
      • hensel_div: panic! → return None when divisor is zero
  • Impact:
    • Eliminates potential DoS via zero divisor
    • Preserves API semantics; callers using expect(...) retain explicit failure handling

@viktorking7 viktorking7 requested review from a team as code owners September 22, 2025 11:18
@viktorking7 viktorking7 requested review from Pratyush, weikengchen and z-tech and removed request for a team September 22, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant