-
Notifications
You must be signed in to change notification settings - Fork 158
Various documentation improvements. #265
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
base: main
Are you sure you want to change the base?
Conversation
The `Complex` type is generic over an associated `RealType`; complex numbers | ||
are represented as two `RealType` values, the real and imaginary parts of the | ||
number. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For broader compatibility with various Markdown viewer implementations, would it be possible to add an extra line before and after such code blocks?
let a: Double = 1 | ||
let b = 2*a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is easier to follow along the arithmetic examples (especially the next one), if this unsupported heterogeneous operator example would re-use the example from C above (and below) – I may be wrong.
let a: Double = 1 | |
let b = 2*a | |
import ComplexModule | |
let r: Double = 1.0 | |
let z = Complex<Double>(0, 2) | |
let w = r + z // ❌ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is to provide an example that would break if we did have a heterogeneous operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right - my example is misleading. Does it make sense to adjust the other two examples then, and make them use multiplication over addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to rearrange stuff to clarify it a little bit, might revisit later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
e77a36a
to
5cc83cc
Compare
This is potentially useful to identify some bugs, but there are also algorithms (notably Kahan summation) that can be written in terms of fast2sum but would fail this check. Rework documentation to account for the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it! Added a few notes but this is overall a huge improvement 👏🏻👏🏻👏🏻
@@ -12,26 +12,29 @@ | |||
extension BinaryInteger { | |||
/// `self` divided by `other`, rounding the result according to `rule`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// `self` divided by `other`, rounding the result according to `rule`. | |
/// Returns the result of dividing this value by `other`, rounding the result | |
/// according to `rule`. |
or (preferred):
/// `self` divided by `other`, rounding the result according to `rule`. | |
/// Returns the result of dividing this value by the given value, rounding | |
/// the result according to specified rule. |
Added some docc catalogs and articles, fixed a bunch of minor errors, all that good stuff. More work needed.