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
+13.6k Golang : Set image canvas or background to transparent
+6.2k Golang : Process non-XML/JSON formatted ASCII text file example
+10k CodeIgniter : Load different view for mobile devices
+7.9k Swift : Convert (cast) String to Float
+9.7k Golang : Find correlation coefficient example
+5.2k Python : Create Whois client or function example
+30k Golang : How to declare kilobyte, megabyte, gigabyte, terabyte and so on?
+9.6k Golang : How to generate Code 39 barcode?
+8.2k Golang : Routes multiplexer routing example with regular expression control
+34.1k Golang : Create x509 certificate, private and public keys
+12.2k Golang : Get remaining text such as id or filename after last segment in URL path
+9.6k Golang : Validate IPv6 example