Added example for Cumprod

This commit is contained in:
btracey
2013-07-19 09:18:56 -07:00
parent f5f551e0de
commit 25dc958b15

View File

@@ -105,3 +105,16 @@ func ExampleCumprod() {
// dst = [1 -2 -6 24]
// s = [1 -2 3 -4]
}
func ExampleCumsum() {
s := []float64{1, -2, 3, -4}
dst := make([]float64, len(s))
Cumprod(dst, s)
fmt.Println("dst = ", dst)
fmt.Println("s = ", s)
// Output:
// dst = [1 -1 2 -2]
// s = [1 -2 3 -4]
}