Go Random Float Generator - Generate Random Floats

Generate random floats in Go with this simple tool. Quickly get three random float numbers. Free and easy to use.

Go Random Float Generator

This tool generates three random float64 numbers using Go's math/rand package.

How to Use

The code below demonstrates how to generate random floats. You can copy and paste this directly into your Go project.

package main

import (
	"fmt"
  "time"
	"math/rand"
)

func floatrandom() float64 {
  rand.Seed(time.Now().UnixNano())
	return rand.Float64()
}

func main() {

	res1 := floatrandom()
	res2 := floatrandom()
	res3 := floatrandom()

	// Displaying results
	fmt.Println("Result 1: ", res1)
	fmt.Println("Result 2: ", res2)
	fmt.Println("Result 3: ", res3)
}

Further Reading

Learn more about random number generation in Go: