Documentation ¶
Overview ¶
Package stats contains statistical functions such as Sum.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sum ¶
Sum calculates the sum of a slice of ordered numeric values.
It iterates over the slice and accumulates the total sum.
Example ¶
package main import ( "fmt" "github.com/xuender/flow/stats" ) func main() { fmt.Println(stats.Sum([]int{1, 2, 3, 4, 5})) fmt.Println(stats.Sum([]string{"a", "b", "c"})) }
Output: 15 abc
Types ¶
Click to show internal directories.
Click to hide internal directories.