Golang math/rand.NormFloat64() function example

package math/rand

Golang math/rand.NormFloat64() function usage example

 package main

 import (
  "fmt"
  "math/rand"
  "time"
 )

 func main() {

  r := rand.New(rand.NewSource(time.Now().UnixNano()))
  fmt.Println(r.NormFloat64())

 }

Reference :

http://golang.org/pkg/math/rand/#NormFloat64

Advertisement