Ejemplo n.º 1
0
func main() {
	xs := []float64{}
	avg := m.Average(xs)
	// min := m.Min(xs)
	// max := m.Max(xs)
	fmt.Println(avg)
}
Ejemplo 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))
}
Ejemplo 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)
}
Ejemplo 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)
}
Ejemplo 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
}
Ejemplo n.º 6
0
func main() {
	xs := []float64{1, 2, 3, 4}
	avg := math.Average(xs)
	fmt.Println(avg)
}
Ejemplo 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))
}
Ejemplo 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)
}