Repository navigation
expand the docs of Complex<T> - #165198
Conversation
|
|
| use crate::ops::{Add, Div, Mul, Neg, Sub}; | ||
|
|
||
| /// A complex number. | ||
| /// A [complex number]. |
There was a problem hiding this comment.
Maybe + `", represented in rectangular form." since that can be important
| /// // Complex addition and subtraction operate pointwise. | ||
| /// assert_eq!(x + y, Complex::new(7.0, 12.0)); | ||
| /// assert_eq!(x - y, Complex::new(3.0, 6.0)); |
There was a problem hiding this comment.
I'm not familiar with the term "pointwise", perhaps "on each component separately"? (Applies a few places)
There was a problem hiding this comment.
It is a math term https://en.wikipedia.org/wiki/Pointwise, but some variation of componentwise/on each component will work just as well
There was a problem hiding this comment.
Oh sheesh I have heard that, flashback to high school math textbooks. I think something about components still fits better though, thanks
4bfcd82 to
4d38b7f
Compare
|
I've added both suggestions |
…tgross35 expand the docs of `Complex<T>` tracking issue: rust-lang#154023 Add some more documentation and examples for `Complex<T>` and its operations. E.g. for `+` the behavior is not obvious without an example. r? tgross35
Rollup of 15 pull requests Successful merges: - #165271 (Re-enable most of `test-aarch64-apple-macos-26-2`) - #165331 (miri subtree update) - #165211 (Streamline function_item_references lint) - #165273 (Add some docs for our allocator `unstable_feature_bound`s) - #165279 (explicitly test the win32 symbol byte count suffix) - #162688 (Fix invalid suggestions and misleading notes for imports) - #165198 (expand the docs of `Complex<T>`) - #165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`) - #165248 (add {Receiver,Sender,SyncSender}::{is_empty,len}) - #165284 (Ensure the display impl of uXX is small with optimize_for_size) - #165287 (Add example of implementing Allocator to its docs) - #165297 (Cleanup `rustdoc-html` tests) - #165298 (Improve diagnostics for notable-trait color arguments) - #165336 (Refactor `analyze_attr` to use a match) - #165338 (`rust-analyzer` subtree update)
Rollup of 15 pull requests Successful merges: - #165271 (Re-enable most of `test-aarch64-apple-macos-26-2`) - #165331 (miri subtree update) - #165211 (Streamline function_item_references lint) - #165273 (Add some docs for our allocator `unstable_feature_bound`s) - #165279 (explicitly test the win32 symbol byte count suffix) - #162688 (Fix invalid suggestions and misleading notes for imports) - #165198 (expand the docs of `Complex<T>`) - #165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`) - #165248 (add {Receiver,Sender,SyncSender}::{is_empty,len}) - #165284 (Ensure the display impl of uXX is small with optimize_for_size) - #165287 (Add example of implementing Allocator to its docs) - #165297 (Cleanup `rustdoc-html` tests) - #165298 (Improve diagnostics for notable-trait color arguments) - #165336 (Refactor `analyze_attr` to use a match) - #165338 (`rust-analyzer` subtree update)
…uwer Rollup of 14 pull requests Successful merges: - #165271 (Re-enable most of `test-aarch64-apple-macos-26-2`) - #165211 (Streamline function_item_references lint) - #165273 (Add some docs for our allocator `unstable_feature_bound`s) - #165279 (explicitly test the win32 symbol byte count suffix) - #162688 (Fix invalid suggestions and misleading notes for imports) - #165198 (expand the docs of `Complex<T>`) - #165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`) - #165248 (add {Receiver,Sender,SyncSender}::{is_empty,len}) - #165284 (Ensure the display impl of uXX is small with optimize_for_size) - #165287 (Add example of implementing Allocator to its docs) - #165297 (Cleanup `rustdoc-html` tests) - #165298 (Improve diagnostics for notable-trait color arguments) - #165336 (Refactor `analyze_attr` to use a match) - #165338 (`rust-analyzer` subtree update)
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#165271 (Re-enable most of `test-aarch64-apple-macos-26-2`) - rust-lang/rust#165211 (Streamline function_item_references lint) - rust-lang/rust#165273 (Add some docs for our allocator `unstable_feature_bound`s) - rust-lang/rust#165279 (explicitly test the win32 symbol byte count suffix) - rust-lang/rust#162688 (Fix invalid suggestions and misleading notes for imports) - rust-lang/rust#165198 (expand the docs of `Complex<T>`) - rust-lang/rust#165231 (Remove redundant parameter from `AttributeParser::parse_attribute_list()` & `AttributeParser::parse_single_args()`) - rust-lang/rust#165248 (add {Receiver,Sender,SyncSender}::{is_empty,len}) - rust-lang/rust#165284 (Ensure the display impl of uXX is small with optimize_for_size) - rust-lang/rust#165287 (Add example of implementing Allocator to its docs) - rust-lang/rust#165297 (Cleanup `rustdoc-html` tests) - rust-lang/rust#165298 (Improve diagnostics for notable-trait color arguments) - rust-lang/rust#165336 (Refactor `analyze_attr` to use a match) - rust-lang/rust#165338 (`rust-analyzer` subtree update)
tracking issue: #154023
Add some more documentation and examples for
Complex<T>and its operations. E.g. for+the behavior is not obvious without an example.r? tgross35