-
Notifications
You must be signed in to change notification settings - Fork 146
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
Implement OpAssign for Complex #274
Conversation
#186's revival. This PR has not properly taken the previous given feedback in review, it should be incorporated. Go for more consistent requirement of Assign traits. |
Are you opposed to now adding a |
NumAssign sounds great. |
|
Can you update this to use |
Would love to see this PR landing. Thanks for the effort!! |
Add tests by expanding the current a + b tests to include a += b, and so on.
d3fb419
to
d57c0c2
Compare
Rebased and applied bors r+ |
274: Implement OpAssign for Complex r=cuviper Design choice: Use by-value forms of OpAssign and use Clone to forward the reference arguments. That matches what the other traits do (for example Add). Design choice: The complex += complex operation needs Add, not just AddAssign. The complex += real operation can use just AddAssign. You could just use Add for both, not sure which way is preferable.
Build succeeded |
Thank you -- I'm sorry I was absent. |
12: Implement OpAssign for Ratio r=cuviper a=c410-f3r Copied shamelessly from [#274](rust-num/num#274) but fixes #5. There is only one problem to solve before anything. Since the implementation doesn't use the `reduce` function, it is possible to exist multiple types of zeros (`0/4`, `0/21`, `0/66`) instead of the default `0/1`, which implies in test errors like `test(_1_2, _NEG1_2, _0);`, therefore, should I rewrite the test suite to be more "zero" friendly?
Design choice: Use by-value forms of OpAssign and use Clone to forward the reference arguments. That matches what the other traits do (for example Add).
Design choice: The complex += complex operation needs Add, not just AddAssign. The complex += real operation can use just AddAssign. You could just use Add for both, not sure which way is preferable.