algebra icon indicating copy to clipboard operation
algebra copied to clipboard

DenseOrSparsePolynomial::divide_with_q_and_r never returns None

Open swasilyev opened this issue 4 years ago • 2 comments

It panics at division by 0: https://github.com/arkworks-rs/algebra/blob/e554fa25a85e18b9bc0caeaf969483031daf7d5e/poly/src/polynomial/univariate/mod.rs#L109

Should we remove Option from the method signature?

swasilyev avatar Nov 17 '21 16:11 swasilyev

The problem seems to be a decision between two choices:

  • panic when the divisor is zero
  • return none when the divisor is zero

which one is better? what do people think?

weikengchen avatar Jan 09 '22 22:01 weikengchen

(ideally we will try not to panic)

weikengchen avatar Jan 09 '22 22:01 weikengchen