Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to avoid cloning #111

Open
konsumlamm opened this issue Sep 15, 2022 · 0 comments
Open

Try to avoid cloning #111

konsumlamm opened this issue Sep 15, 2022 · 0 comments

Comments

@konsumlamm
Copy link

Some operations (most notably multiplication and division) use clone. However, this is inefficient for types with non-trivial Clone impls, such as BigInt or BigDecimal (from the bigdecimal crate). To be fair, most of the time, people will use Complex<f32> or Complex<f64>, so this isn't a major problem, but sometimes people may want to use Complex<BigInt> (for Gaussian integers) or Complex<BigDecimal> (for arbitrary precision arithmetic).

See also rust-num/num-rational#110. This has the same problems and solutions (e.g. using arithmetic on references).

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

No branches or pull requests

1 participant