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
+23.9k Golang : Fix type interface{} has no field or no methods and type assertions example
+16.4k Golang : How to implement two-factor authentication?
+25.5k Golang : Generate MD5 checksum of a file
+4.4k Linux/MacOSX : Search and delete files by extension
+9.3k Golang : How to get username from email address
+14k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+7.9k Golang : Get today's weekday name and calculate target day distance example
+6.9k Golang : Fibonacci number generator examples
+19.2k Golang : Execute shell command
+16.9k Golang : Get the IPv4 and IPv6 addresses for a specific network interface
+11.2k Google Maps URL parameters configuration