Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Intn ¶
Intn generates a random non-negative integer within the range [0, max). The generated integer will be less than the provided maximum value. If max is less than or equal to 0, the function will treat it as if max is 1.
Usage:
max := 10 randomInt := Intn(max) fmt.Printf("Random integer between 0 and %d: %d\n", max, randomInt)
Parameters:
- max (int): The maximum bound for the random integer to be generated.
Returns:
- int: A random non-negative integer within the specified range.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.