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
+21.6k Golang : GORM create record or insert new record into database example
+12.1k Golang : Detect user location with HTML5 geo-location
+12.7k Golang : Add ASCII art to command line application launching process
+8.2k Golang : Find relative luminance or color brightness
+9.7k Golang : Eroding and dilating image with OpenCV example
+5.6k PHP : Fix Call to undefined function curl_init() error
+8.3k Golang : Implementing class(object-oriented programming style)
+9.3k Golang : How to get ECDSA curve and parameters data?
+37.5k Upload multiple files with Go
+6.5k Golang : Calculate diameter, circumference, area, sphere surface and volume
+4.9k Python : Find out the variable type and determine the type with simple test
+12.6k Golang : Exit, terminating or aborting a program