Skip to content

Commit d0e7773

Browse files
committed
#12: Tweaks to documentation
1 parent 244f077 commit d0e7773

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/BasicMathTools/additive reductions.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import Foundation
1212
public extension Sequence where Element: AdditiveArithmetic {
1313

1414
/// Reduces this collection to a single value, assuming the result should be of the same type as each element, and that the starting value for reduction is `.zero`
15+
///
1516
/// - Parameters:
1617
/// - reducer: Processes each element and reduces this collection to a single value
17-
/// - result: The running result of reduction
18+
/// - result: The running result of reduction (starts with `.zero`)
1819
/// - each: Each element of the sequence
1920
///
2021
/// - Returns: The whole collection, reduced down to a single value
@@ -23,7 +24,7 @@ public extension Sequence where Element: AdditiveArithmetic {
2324
}
2425

2526

26-
/// Calculates the sum of all elements in this sequence, through addition, assuming a starting point of `.zero`
27+
/// Returns the sum of all elements in this sequence
2728
func sum() -> Element {
2829
reduce(+=)
2930
}

0 commit comments

Comments
 (0)