Skip to content

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

Merged
merged 20 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Sources/ComplexModule/Documentation.docc/Complex.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# ``Complex``

A Complex number type that conforms to `AlgebraicField`
(so all the normal arithmetic operations are available) and
`ElementaryFunctions` (so all the usual math functions are
available).
A complex number type represented by its real and imaginary parts, and equipped
with the usual arithmetic operators and math functions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯


A `Complex` value is represented with two `RealType` values, corresponding to
the real and imaginary parts of the number.
## Overview

You can access these Cartesian components using the real and imaginary
properties.
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComplexModule/Scale.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
// Complex! Obviously, that doesn't help anyone.

extension Complex {
/// `self` multiplied by the real value `a`.
/// The result of multiplying this value by the real number `a`.
///
/// Equivalent to `self * Complex(a)`, but may be computed more efficiently.
@inlinable @inline(__always)
public func multiplied(by a: RealType) -> Complex {
Complex(x*a, y*a)
}

/// `self` divided by the real value `a`.
/// The result of dividing this value by the real number `a`.
///
/// More efficient than `self / Complex(a)`. May not produce exactly the
/// same result, but will always be more accurate if they differ.
Expand Down