Golang math/rand.Float64() function example
package math/rand
Golang math/rand.Float64() function usage example
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 1000
i := 0
var x float32
for i < n {
x = rand.Float64()
i += 1
}
fmt.Println("x : ", x)
fmt.Println("i : ", i)
}
Reference :
Advertisement
Something interesting
Tutorials
+7.7k Golang : How to execute code at certain day, hour and minute?
+36k Golang : Get file last modified date and time
+18.3k Golang : Get path name to current directory or folder
+16.3k Golang : Find out mime type from bytes in buffer
+14.6k Golang : Send email with attachment(RFC2822) using Gmail API example
+25k Golang : Create PDF file from HTML file
+7.7k Golang : get the current working directory of a running program
+10.2k Golang : How to get quoted string into another string?
+7.7k Golang : Mapping Iban to Dunging alphabets
+12.4k Elastic Search : Return all records (higher than default 10)
+15.6k Golang : ROT47 (Caesar cipher by 47 characters) example