MultivariatePolynomials.jl icon indicating copy to clipboard operation
MultivariatePolynomials.jl copied to clipboard

add type asserts for `MA.operate!` return values

Open nsajko opened this issue 2 years ago • 1 comments

This helps ensure the MutableArithmetics contract is respected. Specifically, MA.operate! should always return its first argument.

Why this instead of performing a stronger check with ===? Because:

  • That would be more verbose
  • The === would sooner have a run time cost than a type assertion

nsajko avatar Nov 26 '23 10:11 nsajko

Is this improving any benchmark or just some double checks ? In any case, please fix the format error and then it should bz good

blegat avatar Dec 04 '23 13:12 blegat