Skip to content

Commit 8b05d1c

Browse files
committed
Update comments on the difference of sum(_:_:) and sum(large:small:)
1 parent 1e72483 commit 8b05d1c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Sources/RealModule/AugmentedArithmetic.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,14 @@ extension Augmented {
102102
/// error from that computation rounded to the closest representable
103103
/// value.
104104
///
105-
/// Unlike `Augmented.sum(large:, small:)`, the magnitude of the summands
106-
/// does not matter. `a.magnitude` might as well be smaller than
107-
/// `b.magnitude` – and vice versa. However, it is recommended to only use
108-
/// this function over `Augmented.sum(large:, small:)` in cases where the
109-
/// ordering of the summands magnitude is unknown at compile time. In cases
110-
/// where either of the summands magnitude is known to be greater than or
111-
/// equal the magnitude of the other summand, use
112-
/// `Augmented.sum(large:, small:)` over this function; as it faster to
113-
/// calculate.
105+
/// Unlike `Augmented.sum(large: a, small: b)`, the magnitude of the summands
106+
/// does not matter and `a.magnitude` might as well be strictly less than
107+
/// `b.magnitude`. However, it is recommended to only use this function over
108+
/// `Augmented.sum(large: a, small: b)` in cases where the ordering of the
109+
/// summands magnitude is unknown at compile time. In cases where either of
110+
/// the summands magnitude is guaranteed to be greater than or equal the
111+
/// magnitude of the other summand, use `Augmented.sum(large: a, small: b)`
112+
/// over this function; as it faster to calculate.
114113
///
115114
/// Unlike `Augmented.product(a, b)`, the rounding error of a sum can
116115
/// never underflow. However, it may not be exactly representable when

0 commit comments

Comments
 (0)