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