Further documentation work for Complex.

This commit is contained in:
Stephen Canon committed 2025-08-08 09:55:59 -04:00
1 parent 450691764d
commit 5b34639450
2 files changed
+19 -30

No files matched your search

@@ -72,3 +72,15 @@ let b = 2*a
operation, `2*a` would either be ambiguous (if there were no type context),
or be inferred to have type `Complex<Double>` (if the expression appeared
in the context of an extension defined on `Complex`).
Note that we _do_ provide heterogeneous multiplication and division by a real
value, spelled as ``Complex/divided(by:)`` and ``Complex/multiplied(by:)``
to avoid ambiguity.
```swift
let z = Complex<Double>(1,3)
let w = z.multiplied(by: 2)
```
These operations are generally more efficient than converting the scale to
a complex number and then using `*` or `/`.