feat: add Sum

This commit is contained in:
dudaodong committed 2023-06-08 16:18:25 +08:00
1 parent 83832daeb1
commit c11d63c2e2
3 files changed
+31

No files matched your search

+12
View File
@@ -122,6 +122,18 @@ func ExampleAverage() {
// 1.3
}
func ExampleSum() {
result1 := Sum(1, 2)
result2 := Sum(0.1, float64(1))
fmt.Println(result1)
fmt.Println(result2)
// Output:
// 3
// 1.1
}
func ExampleMax() {
result1 := Max(1, 2, 3)
result2 := Max(1.2, 1.4, 1.1, 1.4)