Added example for Cumprod

This commit is contained in:
btracey
2013-07-19 09:18:01 -07:00
parent 8a881f32c1
commit f5f551e0de

View File

@@ -92,3 +92,16 @@ func ExampleAddConst() {
// Output:
// s = [6 3 8 1]
}
func ExampleCumprod() {
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 -2 -6 24]
// s = [1 -2 3 -4]
}