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
+5.7k Unix/Linux/MacOSx : Get local IP address
+20.5k nginx: [emerg] unknown directive "passenger_enabled"
+13.9k Golang : Human readable time elapsed format such as 5 days ago
+11.1k Golang : Web routing/multiplex example
+62.7k Golang : Convert HTTP Response body to string
+11.9k Golang : How to parse plain email text and process email header?
+6.3k Golang : Calculate US Dollar Index (DXY)
+7.6k Android Studio : AlertDialog to get user attention example
+22.4k Golang : How to read JPG(JPEG), GIF and PNG files ?
+5.6k PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)
+12k Golang : Find and draw contours with OpenCV example
+5.4k Python : Delay with time.sleep() function example