Beispiel #1
0
func ExampleSumN_cluster() {
	// Example 56.c, p. 394
	var c []float64
	for i := 0; i < 4; i++ {
		c = append(c, 5)
	}
	for i := 0; i < 14; i++ {
		c = append(c, 6)
	}
	for i := 0; i < 23; i++ {
		c = append(c, 7)
	}
	for i := 0; i < 38; i++ {
		c = append(c, 8)
	}
	fmt.Printf("%.2f\n", stellar.SumN(c...))
	// Output:
	// 2.02
}
Beispiel #2
0
func ExampleSumN_triple() {
	// Example 56.b, p. 394
	fmt.Printf("%.2f\n", stellar.SumN(4.73, 5.22, 5.6))
	// Output:
	// 3.93
}