You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal suggests adding a new function, IntInRange(low, high int) int, to the math/rand package.
The function generates random integers within a specified range [low, high).
Function Implementation
funcIntInRange(low, highint) int {
returnrand.Intn(high-low) +low
}
Rationale
It simplifies random integer generation within a specific range, making it easier especially for beginners.
Provides a clean and concise code for this common task.
The text was updated successfully, but these errors were encountered:
Proposal
This proposal suggests adding a new function,
IntInRange(low, high int) int
, to themath/rand
package.The function generates random integers within a specified range [low, high).
Function Implementation
Rationale
The text was updated successfully, but these errors were encountered: