mirror of
https://github.com/gonum/gonum.git
synced 2025-10-19 05:24:52 +08:00
Added example for AddConst
This commit is contained in:
@@ -81,3 +81,14 @@ func ExampleAdd_sliceofslicesum() {
|
|||||||
// Output:
|
// Output:
|
||||||
// result = [0 5 10]
|
// result = [0 5 10]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ExampleAddConst() {
|
||||||
|
s := []float64{1, -2, 3, -4}
|
||||||
|
c := 5.0
|
||||||
|
|
||||||
|
AddConst(s, c)
|
||||||
|
|
||||||
|
fmt.Println("s = ", s)
|
||||||
|
// Output:
|
||||||
|
// s = [6 3 8 1]
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user