Go math Package Sqrt()
package main/*from w w w. j av a 2s . co m*/ import ( "fmt" "math" ) func main(){ var num[10] float64 var sum,mean,sd float64 for i := 1; i <= 10; i++ { num[i-1] = float64(i) + 123 sum += num[i-1] } mean = sum/10; for j := 0; j < 10; j++ { sd += math.Pow(num[j] - mean, 2) } sd = math.Sqrt(sd/10) fmt.Println("The Standard Deviation is : ",sd) }