Go sort Package Float64sAreSorted()
package main/*from w w w .j ava 2 s . co m*/ import ( "fmt" "sort" ) func main() { val := []float64{2.5,6.3,1.5,9.8,4.7,1.1,5.2} fmt.Println(val) if sort.Float64sAreSorted(val)==false{ sort.Float64s(val) // Sort Float Array } fmt.Println(val) fmt.Println(sort.SearchFloat64s(val,5.2)) }