Esempio n. 1
0
func main() {
	xs := []float64{}
	avg := m.Average(xs)
	// min := m.Min(xs)
	// max := m.Max(xs)
	fmt.Println(avg)
}
Esempio n. 2
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := math.Average(xs)
	fmt.Println(avg)
	fmt.Println("min =", math.Min(xs))
	fmt.Println("max =", math.Max(xs))
}
Esempio n. 3
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := math.Average(xs)
	min := math.Minimum(xs)
	max := math.Maximum(xs)
	fmt.Println("Average", avg)
	fmt.Println("Minimum", min)
	fmt.Println("Maximum", max)
}
Esempio n. 4
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := m.Average(xs)
	min := m.Min(xs)
	max := m.Max(xs)
	fmt.Println(xs)
	fmt.Println(avg)
	fmt.Println(min)
	fmt.Println(max)
}
Esempio n. 5
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := math.Average(xs)
	fmt.Println(avg)

	fmt.Println(math.Increment(1))

	// automatically generate documentation for packages:
	// godoc golang-book/chapter11/math Average

	// this documentation is also available in web form:
	// godoc -http=":6060"
	// navigate to localhost:6060/pkg
}
Esempio n. 6
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := math.Average(xs)
	fmt.Println(avg)
}
Esempio n. 7
0
func main() {
	xs := []float64{1, 2, 3, 4}
	fmt.Println("Avg =", math.Average(xs))
	fmt.Println("Min =", math.Min(xs))
	fmt.Println("Max =", math.Max(xs))
}
Esempio n. 8
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := m.Average(xs)
	min, max := m.MinMax(xs)
	fmt.Println(avg, min, max)
}