Currently, the arithmetic operations do a lot of clones. However, this is quite inefficient when using types with non-trivial Clone impls, such as BigInt in BigRational. We could instead do the operations on references, to avoid the cloning. However, since the impls use the Integer trait, which only supports arithmetic operations on owned values, it seems this would need new trait bounds (like NumRef or RefNum).
Currently, the arithmetic operations do a lot of
clones. However, this is quite inefficient when using types with non-trivialCloneimpls, such asBigIntinBigRational. We could instead do the operations on references, to avoid the cloning. However, since the impls use theIntegertrait, which only supports arithmetic operations on owned values, it seems this would need new trait bounds (likeNumReforRefNum).