-
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
Open
stephentyrone
wants to merge
17
commits into
apple:main
Choose a base branch
from
stephentyrone:docc-stuff
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5d84256
Initial work on docc setup.
stephentyrone 129e496
Further docc work.
stephentyrone d2f6811
More docc changes.
stephentyrone 95e9441
Changes from review feedback.
stephentyrone 4506917
typo.
stephentyrone 5b34639
Further documentation work for Complex.
stephentyrone 5cc83cc
WIP
stephentyrone 2361b49
Add overview for RealModule documentation.
stephentyrone af0352e
Some additional organization for Complex docc.
stephentyrone acbf425
Remove precondition assert from Augmented.sum(large:small:)
stephentyrone 9c54880
Massage docc files to make the Documentation check happier
stephentyrone c3757dc
Fix typo. (Thanks, Guillaume)
stephentyrone 61a8b91
Some formatting cleanup around code blocks.
stephentyrone b43c10c
Merge branch 'main' into docc-stuff
stephentyrone 8b2fd7b
Provide transliteration of Чебышёв.
stephentyrone 2213879
Further review edits from Nate.
stephentyrone 2c19b7b
Last few review notes on complex.
stephentyrone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# ``Complex`` | ||
|
||
A complex number type represented by its real and imaginary parts, and equipped | ||
with the usual arithmetic operators and math functions. | ||
|
||
## Overview | ||
|
||
You can access these Cartesian components using the real and imaginary | ||
properties. | ||
|
||
```swift | ||
let z = Complex(1,-1) // 1 - i | ||
let re = z.real // 1 | ||
let im = z.imaginary // -1 | ||
``` | ||
|
||
All `Complex` numbers with a non-finite component are treated as a single | ||
"point at infinity," with infinite magnitude and indeterminant phase. Thus, | ||
the real and imaginary parts of an infinity are nan. | ||
|
||
```swift | ||
let w = Complex<Double>.infinity | ||
w == -w // true | ||
let re = w.real // .nan | ||
let im = w.imag // .nan | ||
``` | ||
|
||
See <doc:Infinity> for more details. | ||
|
||
The ``magnitude`` property of a complex number is the infinity norm of the | ||
value (a.k.a. “maximum norm” or “Чебышёв [Chebyshev] norm”). To get the two | ||
norm (a.k.a. "Euclidean norm"), use the ``length`` property. See | ||
<doc:Magnitude> for more details. | ||
|
||
## Topics | ||
|
||
### Real and imaginary parts | ||
|
||
- ``real`` | ||
- ``imaginary`` | ||
- ``rawStorage`` | ||
- ``init(_:_:)`` | ||
- ``init(_:)-5aesj`` | ||
- ``init(imaginary:)`` | ||
|
||
### Phase, length and magnitude | ||
|
||
- ``magnitude`` | ||
- ``length`` | ||
- ``lengthSquared`` | ||
- ``normalized`` | ||
- ``phase`` | ||
- ``polar`` | ||
- ``init(length:phase:)`` | ||
|
||
### Scaling by real numbers | ||
- ``multiplied(by:)`` | ||
- ``divided(by:)`` | ||
|
||
### Complex-specific operations | ||
- ``conjugate`` | ||
|
||
### Classification | ||
- ``isZero`` | ||
- ``isSubnormal`` | ||
- ``isNormal`` | ||
- ``isFinite`` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
💯