Golang math/rand.Float32() function example
package math/rand
Golang math/rand.Float32() function usage example
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 1000
i := 0
var x float32
for i < n {
x = rand.Float32()
i += 1
}
fmt.Println("x : ", x)
fmt.Println("i : ", i)
}
Reference :
Advertisement
Something interesting
Tutorials
+8.8k Golang : HTTP Routing with Goji example
+21.7k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+21.3k Golang : Create and resolve(read) symbolic links
+12.5k Golang : Arithmetic operation with numerical slices or arrays example
+7.9k Javascript : How to check a browser's Do Not Track status?
+4.8k Which content-type(MIME type) to use for JSON data
+9.6k Golang : Read file with ioutil
+17.4k Golang : Check if IP address is version 4 or 6
+30.9k Golang : Interpolating or substituting variables in string examples
+14k Golang : Reverse IP address for reverse DNS lookup example
+9k Golang : Build and compile multiple source files
+15.9k Golang : Update database with GORM example